gigafibre-fsm/apps/ops/src-pwa/register-service-worker.js
louispaulb 7d7b4fdb06 feat: nested tasks, project wizard, n8n webhooks, inline task editing
Major dispatch/task system overhaul:
- Project templates with 3-step wizard (choose template → edit steps → publish)
- 4 built-in templates: phone service, fiber install, move, repair
- Nested task tree with recursive TaskNode component (parent_job hierarchy)
- n8n webhook integration (on_open_webhook, on_close_webhook per task)
- Inline task editing: status, priority, type, tech assignment, tags, delete
- Tech assignment + tags from ticket modal → jobs appear on dispatch timeline
- ERPNext custom fields: parent_job, on_open_webhook, on_close_webhook, step_order
- Refactored ClientDetailPage, ChatterPanel, DetailModal, dispatch store
- CSS consolidation, dead code cleanup, composable extraction
- Dashboard KPIs with dispatch integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 13:01:20 -04:00

20 lines
492 B
JavaScript

import { register } from 'register-service-worker'
register(process.env.SERVICE_WORKER_FILE, {
ready () {},
registered (reg) {
// Check for updates every 5 minutes
setInterval(() => { reg.update() }, 5 * 60 * 1000)
},
cached () {},
updatefound () {},
updated (reg) {
// New service worker available — activate it silently (no reload)
if (reg && reg.waiting) {
reg.waiting.postMessage({ type: 'SKIP_WAITING' })
}
},
offline () {},
error () {}
})