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 === "") {
|
||||
return;
|
||||
}
|
||||
if (a.href.startsWith("#")) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const url = new URL(a.href);
|
||||
const qs = url.search || "";
|
||||
a.href = `#${url.pathname}${qs}`;
|
||||
const hash = (url.hash || "#").substring(2, Infinity);
|
||||
a.href = `#${url.pathname}${qs}${hash}`;
|
||||
} catch (e) {
|
||||
console.debug(`authentik/site-shell: error ${e}`);
|
||||
a.href = `#${a.href}`;
|
||||
|
|
Reference in New Issue