static: fix behaviour on initial load when no route is given
This commit is contained in:
parent
5da8caf0d4
commit
3cfe144394
2
passbook/static/static/dist/main.js
vendored
2
passbook/static/static/dist/main.js
vendored
File diff suppressed because one or more lines are too long
2
passbook/static/static/dist/main.js.map
vendored
2
passbook/static/static/dist/main.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -67,6 +67,8 @@ export class RouterOutlet extends LitElement {
|
|||
let activeUrl = window.location.hash.slice(1, Infinity);
|
||||
if (activeUrl === "") {
|
||||
activeUrl = this.defaultUrl!;
|
||||
window.location.hash = `#${activeUrl}`;
|
||||
return;
|
||||
}
|
||||
ROUTES.forEach((route) => {
|
||||
let selectedRoute: Route | null = null;
|
||||
|
@ -77,7 +79,6 @@ export class RouterOutlet extends LitElement {
|
|||
console.log(
|
||||
`passbook/router: route "${activeUrl}" not defined, defaulting to shell`
|
||||
);
|
||||
window.location.hash = `#${activeUrl}`;
|
||||
selectedRoute = {
|
||||
url: RegExp(""),
|
||||
element: html`<pb-site-shell url=${activeUrl}
|
||||
|
|
Reference in a new issue