mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-11 08:08:46 +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]/",
|
||||
"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]/"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,14 @@ export function initState(l: StateUpdater<string>) {
|
||||
l("#/");
|
||||
}
|
||||
});
|
||||
self.addEventListener("hashchange", (_) => {
|
||||
const hash = document.location.hash;
|
||||
if (!hash || hash == "#") {
|
||||
l("#/");
|
||||
} else {
|
||||
l(hash);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export const set_state: StateUpdater<string> = (updater) => {
|
||||
|
||||
Reference in New Issue
Block a user