diff --git a/public/icon-192x192.png b/public/icon-192x192.png new file mode 100644 index 00000000..f5a709ad Binary files /dev/null and b/public/icon-192x192.png differ diff --git a/public/icon-512x512.png b/public/icon-512x512.png new file mode 100644 index 00000000..3d566082 Binary files /dev/null and b/public/icon-512x512.png differ diff --git a/public/screenshot-1280x720.png b/public/screenshot-1280x720.png new file mode 100644 index 00000000..424a520d Binary files /dev/null and b/public/screenshot-1280x720.png differ diff --git a/public/screenshot-540x720.png b/public/screenshot-540x720.png new file mode 100644 index 00000000..35ebaa39 Binary files /dev/null and b/public/screenshot-540x720.png differ diff --git a/public/sw.js b/public/sw.js index db44454a..4110d0c8 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,26 +1,16 @@ /* eslint-disable no-undef */ -// Self-destructing service worker. -// -// The previous version of this file used a cache-first strategy with no -// dev-mode guard, which pinned stale JS/HTML chunks until a hard reload. -// This replacement unregisters itself and wipes all caches as soon as the -// browser picks it up. Browsers re-fetch sw.js on every navigation to check -// for updates, so any client running the old worker will swap to this one -// on their next page load and then lose the worker entirely. +// Minimal service worker – satisfies the PWA installability requirement +// without caching any assets. All requests fall through to the network, +// so there is no risk of serving stale chunks after a deployment. self.addEventListener("install", () => { self.skipWaiting(); }); self.addEventListener("activate", (event) => { - event.waitUntil( - (async () => { - const cacheNames = await caches.keys(); - await Promise.all(cacheNames.map((name) => caches.delete(name))); - await self.registration.unregister(); - const clients = await self.clients.matchAll({ type: "window" }); - clients.forEach((client) => client.navigate(client.url)); - })(), - ); + event.waitUntil(self.clients.claim()); }); + +// Network-only fetch handler – no caching. +self.addEventListener("fetch", () => {});