mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Previously the service worker used registerType: 'autoUpdate' with the default injected register script - a new deploy would install and activate a new SW in the background, but an already-open tab kept running the old JS/CSS from memory with no indication a newer version existed, short of a manual hard reload (or clearing SW/ caches by hand, which we had to do repeatedly while verifying deploys this session). Switch to registerType: 'prompt' and register the SW ourselves via virtual:pwa-register/react (useRegisterSW), showing a small "new version available" toast with a reload button when an update is waiting. Also poll registration.update() hourly so long-lived tabs notice updates without needing a fresh navigation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4 lines
135 B
TypeScript
4 lines
135 B
TypeScript
/// <reference types="vite/client" />
|
|
/// <reference types="vite-plugin-pwa/client" />
|
|
/// <reference types="vite-plugin-pwa/react" />
|