update sw
Deploy app frontend / app frontend (push) Successful in 1m29s

This commit is contained in:
2024-12-05 11:04:04 +02:00
parent 9c0ce14013
commit ddcda323a1
6 changed files with 217 additions and 192 deletions
+1 -15
View File
@@ -31,7 +31,6 @@ const MyPreset = definePreset(Aura, {
import App from './App.vue'
import router from './router'
import { registerServiceWorker } from '@/registerServiceWorker'
const app = createApp(App)
@@ -61,21 +60,8 @@ app.use(PrimeVue, {
},
},
})
app.config.globalProperties.$swDebug = ref([])
app.mount('#app')
registerServiceWorker()
.then(() => {
console.log('Service Worker успешно зарегистрирован')
navigator.serviceWorker.addEventListener('message', (event) => {
console.debug('serviceWorker message', event.data)
if (event.data.type === 'notificationClick' && !event.data.matchUrl) {
const url = new URL(event.data.url, location.origin)
console.debug('go to', `${url.pathname}${url.search}${url.hash}`)
router.push(`${url.pathname}${url.search}${url.hash}`)
}
})
})
.catch(console.error)
window.PouchDB = PouchDB // it for debug in console only