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