web: fix SiteShell breaking links when handlers are updated twice
This commit is contained in:
parent
a07d7456c8
commit
7b60bca297
|
@ -89,10 +89,14 @@ export class SiteShell extends LitElement {
|
||||||
if (a.href === "") {
|
if (a.href === "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (a.href.startsWith("#")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const url = new URL(a.href);
|
const url = new URL(a.href);
|
||||||
const qs = url.search || "";
|
const qs = url.search || "";
|
||||||
a.href = `#${url.pathname}${qs}`;
|
const hash = (url.hash || "#").substring(2, Infinity);
|
||||||
|
a.href = `#${url.pathname}${qs}${hash}`;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.debug(`authentik/site-shell: error ${e}`);
|
console.debug(`authentik/site-shell: error ${e}`);
|
||||||
a.href = `#${a.href}`;
|
a.href = `#${a.href}`;
|
||||||
|
|
Reference in New Issue