aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/+layout.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/+layout.svelte')
-rw-r--r--src/routes/(app)/+layout.svelte5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte
index f6c496c4..6cbcad2b 100644
--- a/src/routes/(app)/+layout.svelte
+++ b/src/routes/(app)/+layout.svelte
@@ -172,6 +172,11 @@
onMount(async () => {
if (browser) {
+ if (import.meta.env.DEV && navigator.serviceWorker) {
+ const regs = await navigator.serviceWorker.getRegistrations();
+ for (const reg of regs) reg.unregister();
+ }
+
$offline = !navigator.onLine;
const goOnline = () => ($offline = false);
const goOffline = () => ($offline = true);