17 lines
534 B
JavaScript
17 lines
534 B
JavaScript
// Minimal service worker — registers for PWA installability.
|
|
// No offline cache for v1; the app requires network. We just handle
|
|
// update prompts and skipWaiting on new versions.
|
|
|
|
self.addEventListener('install', (event) => {
|
|
self.skipWaiting();
|
|
});
|
|
|
|
self.addEventListener('activate', (event) => {
|
|
event.waitUntil(self.clients.claim());
|
|
});
|
|
|
|
// Pass-through fetch — no caching. This keeps data fresh; v2 will add
|
|
// a stale-while-revalidate layer for static assets.
|
|
self.addEventListener('fetch', () => {
|
|
/* no-op */
|
|
});
|