Fix history.repalceState
This commit is contained in:
@ -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 () {
|
||||
|
Reference in New Issue
Block a user