Fix history.repalceState
This commit is contained in:
@ -40,7 +40,7 @@ function handleHash(hash) {
|
|||||||
case "/login": createLoginWindow(); break;
|
case "/login": createLoginWindow(); break;
|
||||||
default:
|
default:
|
||||||
console.error(`Invalid url hash "${hash}"`);
|
console.error(`Invalid url hash "${hash}"`);
|
||||||
hash = "/welcome";
|
hash = defaultLocation;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,9 +53,9 @@ function handleUrl(url) {
|
|||||||
let hash = new URL(url).hash;
|
let hash = new URL(url).hash;
|
||||||
if (hash === '') {
|
if (hash === '') {
|
||||||
history.replaceState(null, null, `#${defaultLocation}`);
|
history.replaceState(null, null, `#${defaultLocation}`);
|
||||||
} else {
|
hash = defaultLocation;
|
||||||
handleHash(hash);
|
|
||||||
}
|
}
|
||||||
|
handleHash(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("load", function () {
|
window.addEventListener("load", function () {
|
||||||
|
Reference in New Issue
Block a user