From 6c0ea007091dae13e071283daee86a6de2a9f66f Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 21 Nov 2023 15:11:11 +0000 Subject: [PATCH] fix: unregister existing sws --- src/routes/+page.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 2b8eaad..2828a0a 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -15,6 +15,11 @@ //Service Worker if ('serviceWorker' in navigator) { console.log('registering service worker...'); + navigator.serviceWorker.getRegistrations().then((registrations) => { + for (let registration of registrations) { + registration.unregister(); + } + }); navigator.serviceWorker.register('src/sw.js'); } else { console.log('service worker not supported');