push notification
fix implemented
This commit is contained in:
1 parent
0bbf2ab56f
commit
57864e00da
15 files changed
+5126
-26
No files matched your search
+19
-1
@@ -5,12 +5,30 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { router } from './routes'
|
||||
import { AuthProvider } from './contexts/AuthContext'
|
||||
import { initializeTheme } from './lib/theme'
|
||||
import 'virtual:pwa-register'
|
||||
import { registerSW } from 'virtual:pwa-register'
|
||||
|
||||
initializeTheme()
|
||||
|
||||
const queryClient = new QueryClient()
|
||||
|
||||
// Register service worker
|
||||
const updateSW = registerSW({
|
||||
onNeedRefresh() {
|
||||
if (confirm('New content available. Reload?')) {
|
||||
updateSW(true)
|
||||
}
|
||||
},
|
||||
onOfflineReady() {
|
||||
console.log('App ready to work offline')
|
||||
},
|
||||
onRegistered(registration) {
|
||||
console.log('SW Registered:', registration?.scope)
|
||||
},
|
||||
onRegisterError(error) {
|
||||
console.error('SW registration error:', error)
|
||||
},
|
||||
})
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
|
||||
Reference in new issue
Block a user