// Retired service worker location (the app now uses /sw-.js). Devices that // still run the old worker get this one as an update: it removes itself and // reloads open windows, which then register the current worker. self.addEventListener("install", () => self.skipWaiting()); self.addEventListener("activate", (event) => { event.waitUntil( (async () => { const keys = await caches.keys(); await Promise.all(keys.map((k) => caches.delete(k))); await self.registration.unregister(); const windows = await self.clients.matchAll({ type: "window" }); windows.forEach((w) => w.navigate(w.url)); })(), ); });