fix(app): register service worker after load (#44294)

This commit is contained in:
Brendan Allan 2026-08-23 10:50:56 +08:00 committed by GitHub
parent 92658e4389
commit 1ce7e90d3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -42,6 +42,10 @@ const clearAuthToken = () => {
const web = createWebPlatform(pkg.version)
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => void navigator.serviceWorker.register("/sw.js"), { once: true })
}
if (import.meta.env.VITE_SENTRY_DSN) {
init({
dsn: import.meta.env.VITE_SENTRY_DSN,

View file

@ -25,6 +25,7 @@ export default defineConfig({
desktopPlugin,
VitePWA({
strategies: "generateSW",
injectRegister: false,
manifest: false,
workbox: {
cleanupOutdatedCaches: true,