Fix history.repalceState

This commit is contained in:
2021-05-08 21:17:15 +02:00
parent f710430f53
commit a0f08bc3a4

View File

@ -40,7 +40,7 @@ function handleHash(hash) {
case "/login": createLoginWindow(); break;
default:
console.error(`Invalid url hash "${hash}"`);
hash = "/welcome";
hash = defaultLocation;
break;
}
@ -53,9 +53,9 @@ function handleUrl(url) {
let hash = new URL(url).hash;
if (hash === '') {
history.replaceState(null, null, `#${defaultLocation}`);
} else {
handleHash(hash);
hash = defaultLocation;
}
handleHash(hash);
}
window.addEventListener("load", function () {