diff --git a/web/app/components/provider/serwist.tsx b/web/app/components/provider/serwist.tsx index 696012e3ee..4f43c751c1 100644 --- a/web/app/components/provider/serwist.tsx +++ b/web/app/components/provider/serwist.tsx @@ -1,9 +1,20 @@ 'use client' import { SerwistProvider } from '@serwist/turbopack/react' +import { useEffect } from 'react' import { IS_DEV } from '@/config' export function PWAProvider({ children }: { children: React.ReactNode }) { + useEffect(() => { + if (IS_DEV && 'serviceWorker' in navigator) { + navigator.serviceWorker.getRegistrations().then((registrations) => { + registrations.forEach((registration) => { + registration.unregister() + }) + }) + } + }, []) + if (IS_DEV) { return <>{children} }