Release 202506091000

This commit is contained in:
pluja
2025-06-09 10:00:55 +00:00
parent 8b90b3eef6
commit 87f0f36aa1
61 changed files with 5216 additions and 730 deletions

21
web/src/pwa.ts Normal file
View File

@@ -0,0 +1,21 @@
import { registerSW } from 'virtual:pwa-register'
declare global {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
interface Window {
__SW_REGISTRATION__?: ServiceWorkerRegistration
}
}
export const updateSW = registerSW({
immediate: true,
onRegisteredSW: (_swScriptUrl, registration) => {
if (registration) window.__SW_REGISTRATION__ = registration
},
onNeedRefresh: () => {
void updateSW(true)
},
onRegisterError: (error) => {
console.error('Service Worker registration error', error)
},
})