if there are ever issues with dialogs and toasts together, you may want to add `pointer-events-auto` to the Toaster class https://github.com/unovue/shadcn-vue/blob/dev/apps/www/src/content/docs/components/sonner.md#sonner-with-dialog
30 lines
648 B
TypeScript
30 lines
648 B
TypeScript
import { createApp } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import App from './App.vue'
|
|
import router from './router'
|
|
import { i18n } from './i18n'
|
|
import './assets/index.css'
|
|
import { registerSW } from 'virtual:pwa-register'
|
|
import 'vue-sonner/style.css'
|
|
|
|
const app = createApp(App)
|
|
const pinia = createPinia()
|
|
|
|
app.use(router)
|
|
app.use(i18n)
|
|
app.use(pinia)
|
|
|
|
// Simple periodic service worker updates
|
|
const intervalMS = 60 * 60 * 1000 // 1 hour
|
|
registerSW({
|
|
onRegistered(r) {
|
|
r && setInterval(() => {
|
|
r.update()
|
|
}, intervalMS)
|
|
},
|
|
onOfflineReady() {
|
|
console.log('App ready to work offline')
|
|
}
|
|
})
|
|
|
|
app.mount('#app')
|