mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-25 04:02:33 +00:00
fix(app): register service worker after load (#44294)
This commit is contained in:
parent
92658e4389
commit
1ce7e90d3e
2 changed files with 5 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ export default defineConfig({
|
|||
desktopPlugin,
|
||||
VitePWA({
|
||||
strategies: "generateSW",
|
||||
injectRegister: false,
|
||||
manifest: false,
|
||||
workbox: {
|
||||
cleanupOutdatedCaches: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue