mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-07 16:19:09 +00:00
Update PWA registration comment to match autoUpdate behavior
The previous comment described prompt-mode behavior, but the SW is now configured with autoUpdate. Document the reload tradeoff explicitly so the comment no longer contradicts the VitePWA setting. Refs: #86
This commit is contained in:
parent
5cf60b361f
commit
bfcdb15606
1 changed files with 6 additions and 3 deletions
|
|
@ -3,9 +3,12 @@ import { StrictMode } from "react"
|
||||||
import { hydrateRoot } from "react-dom/client"
|
import { hydrateRoot } from "react-dom/client"
|
||||||
import { registerSW } from "virtual:pwa-register"
|
import { registerSW } from "virtual:pwa-register"
|
||||||
|
|
||||||
// prompt mode: a new SW installs in the background and takes over on the next
|
// autoUpdate: vite-plugin-pwa generates a SW that calls skipWaiting and
|
||||||
// load, so deploys never reload a tab mid-agent-run. Skip in dev — the SW
|
// clientsClaim, so a new deploy activates for existing tabs. Open dashboard
|
||||||
// precaches production-only build artifacts that 404 against the dev server.
|
// tabs may reload when the service worker takes over; this is acceptable for
|
||||||
|
// a dev/internal dashboard where silent updates are preferred over stale
|
||||||
|
// bundles. Skip in dev — the SW precaches production-only build artifacts that
|
||||||
|
// 404 against the dev server.
|
||||||
if (import.meta.env.PROD) {
|
if (import.meta.env.PROD) {
|
||||||
registerSW()
|
registerSW()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue