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; 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 () {