diff --git a/src/index.tsx b/src/index.tsx index 4afd1f87e..b5a372ef7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -49,6 +49,15 @@ if (flags.pwa) { } }, }); +} else { + // Clean up if we've disabled the flag + if ("serviceWorker" in navigator) { + navigator.serviceWorker.getRegistration().then((registration) => { + registration?.unregister().then(() => { + window.location.reload(); + }); + }); + } } const root = createRoot(document.getElementById("root")!);