gigafibre-fsm/apps/ops/src-pwa/register-service-worker.js
louispaulb 13dcd4bf77 feat: add ops app + CONTEXT.md, simplify URL to /ops/
Ops app (Vue/Quasar PWA) with dispatch V2 integration, tag system,
customer 360, tickets, and dashboard. Served via standalone nginx
container at erp.gigafibre.ca/ops/ with Traefik StripPrefix + Authentik SSO.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:41:58 -04:00

21 lines
511 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 and reload
if (reg && reg.waiting) {
reg.waiting.postMessage({ type: 'SKIP_WAITING' })
}
window.location.reload()
},
offline () {},
error () {}
})