This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user