From 4492b892730d237dde56a87b782ac41f21eb92b6 Mon Sep 17 00:00:00 2001 From: zumbiepig <121742281+zumbiepig@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:43:55 -0700 Subject: [PATCH] fix --- src/resources/scripts/main.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/resources/scripts/main.ts b/src/resources/scripts/main.ts index 71e5902..97da94a 100644 --- a/src/resources/scripts/main.ts +++ b/src/resources/scripts/main.ts @@ -293,11 +293,19 @@ const serviceworker = { if ('serviceWorker' in navigator) { navigator.serviceWorker.getRegistrations().then((registrations) => { for (const registration of registrations) { - registration.unregister(); + registration.unregister().then(() => { + caches.keys().then((keyList) => { + return Promise.all( + keyList.map((key) => { + return caches.delete(key); + }) + ); + }); + }); } }); } - } + }, }; if (window.location.pathname === '/') {