Files
archy/packages/app/dev-dist/sw.js
T
DorianandClaude Opus 4.6 9dbc9c24a6 chore: overnight plan 2026-03-04 + /overnight command
- Rewrote loop/plan.md with 34 checkbox tasks across 8 phases
- Updated loop/prompt.md for new overnight scope
- Added .claude/commands/overnight.md skill
- Self-destructing dev SW from previous session

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 21:34:33 +00:00

10 lines
436 B
JavaScript

// Self-destructing service worker: unregisters itself and clears caches
self.addEventListener('install', () => self.skipWaiting())
self.addEventListener('activate', async () => {
const keys = await caches.keys()
await Promise.all(keys.map(k => caches.delete(k)))
const clients = await self.clients.matchAll({ type: 'window' })
for (const client of clients) client.navigate(client.url)
await self.registration.unregister()
})