From 0b25148fb9593283044e4b484cd6602afaf8eb24 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 22 Feb 2024 17:13:53 +0100 Subject: [PATCH] chore: yeet service workers when in dev environment --- frontend/src/ts/ready.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/ts/ready.ts b/frontend/src/ts/ready.ts index 24b401fd0..9554990b7 100644 --- a/frontend/src/ts/ready.ts +++ b/frontend/src/ts/ready.ts @@ -92,6 +92,16 @@ $(document).ready(() => { MonkeyPower.init(); new Konami("https://keymash.io/"); + + if (Misc.isDevEnvironment()) { + void navigator.serviceWorker + .getRegistrations() + .then(function (registrations) { + for (const registration of registrations) { + void registration.unregister(); + } + }); + } }); window.onerror = function (message, url, line, column, error): void {