Fix small bug with ProxyRegistrar on first load.
This commit is contained in:
parent
390f3e73d9
commit
74cd71e255
2 changed files with 89 additions and 85 deletions
|
|
@ -54,6 +54,8 @@
|
||||||
|
|
||||||
async function loadContent() {
|
async function loadContent() {
|
||||||
await initTransport();
|
await initTransport();
|
||||||
|
// The setTimeout is because service workers are a little silly and can take a while longer to register despite .then being called, which causes a bug on the first load.
|
||||||
|
setTimeout(async () => {
|
||||||
let openWith = localStorage.getItem("alu__selectedOpenWith");
|
let openWith = localStorage.getItem("alu__selectedOpenWith");
|
||||||
let currentProxy = localStorage.getItem("alu__selectedProxy");
|
let currentProxy = localStorage.getItem("alu__selectedProxy");
|
||||||
let url = input!.value.trim();
|
let url = input!.value.trim();
|
||||||
|
|
@ -140,6 +142,7 @@
|
||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function formEventListener(event: Event) {
|
async function formEventListener(event: Event) {
|
||||||
|
|
|
||||||
|
|
@ -311,9 +311,10 @@ const t = i18n.useTranslations(lang);
|
||||||
const useWss = location.protocol == "https:";
|
const useWss = location.protocol == "https:";
|
||||||
const webSocketProtocol = useWss ? "wss://" : "ws://";
|
const webSocketProtocol = useWss ? "wss://" : "ws://";
|
||||||
let savedWispUrl = localStorage.getItem("alu__wispUrl");
|
let savedWispUrl = localStorage.getItem("alu__wispUrl");
|
||||||
if (savedWispUrl == null) localStorage.setItem("alu__wispUrl", webSocketProtocol + location.host + "/wisp/");
|
if (savedWispUrl == null)
|
||||||
|
localStorage.setItem("alu__wispUrl", webSocketProtocol + location.host + "/wisp/");
|
||||||
let savedBareUrl = localStorage.getItem("alu__bareUrl");
|
let savedBareUrl = localStorage.getItem("alu__bareUrl");
|
||||||
if (savedBareUrl == null) localStorage.setItem("alu__bareUrl", location.origin + "/bare/")
|
if (savedBareUrl == null) localStorage.setItem("alu__bareUrl", location.origin + "/bare/");
|
||||||
wispURLInput.value = localStorage.getItem("alu__wispUrl");
|
wispURLInput.value = localStorage.getItem("alu__wispUrl");
|
||||||
bareURLInput.value = localStorage.getItem("alu__bareUrl");
|
bareURLInput.value = localStorage.getItem("alu__bareUrl");
|
||||||
// Proxy settings
|
// Proxy settings
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue