mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Update @material/web ti 1.0.0-pre.13
add Listener to hashchange event
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
"pbkdf2-hmac": "https://esm.sh/[email protected]",
|
"pbkdf2-hmac": "https://esm.sh/[email protected]",
|
||||||
"pbkdf2-hmac/": "https://esm.sh/[email protected]/",
|
"pbkdf2-hmac/": "https://esm.sh/[email protected]/",
|
||||||
"randomstring": "https://esm.sh/[email protected]",
|
"randomstring": "https://esm.sh/[email protected]",
|
||||||
"@material/web/": "https://unpkg.lifegpc.workers.dev/@material/[email protected]2/",
|
"@material/web/": "https://unpkg.lifegpc.workers.dev/@material/[email protected]3/",
|
||||||
"@lit-labs/react/": "https://esm.sh/@lit-labs/[email protected]/"
|
"@lit-labs/react/": "https://esm.sh/@lit-labs/[email protected]/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,14 @@ export function initState(l: StateUpdater<string>) {
|
|||||||
l("#/");
|
l("#/");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
self.addEventListener("hashchange", (_) => {
|
||||||
|
const hash = document.location.hash;
|
||||||
|
if (!hash || hash == "#") {
|
||||||
|
l("#/");
|
||||||
|
} else {
|
||||||
|
l(hash);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const set_state: StateUpdater<string> = (updater) => {
|
export const set_state: StateUpdater<string> = (updater) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user