Create service worker in app
This commit is contained in:
parent
5eb9c030fd
commit
a959104333
3 changed files with 5 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ import EditStatusModal from './components/edit_status_modal/edit_status_modal.vu
|
|||
import PostStatusModal from './components/post_status_modal/post_status_modal.vue'
|
||||
import StatusHistoryModal from './components/status_history_modal/status_history_modal.vue'
|
||||
import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue'
|
||||
import { getOrCreateServiceWorker } from './services/sw/sw'
|
||||
import { windowWidth, windowHeight } from './services/window_utils/window_utils'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
|
|
@ -65,6 +66,7 @@ export default {
|
|||
if (useInterfaceStore().themeApplied) {
|
||||
this.removeSplash()
|
||||
}
|
||||
getOrCreateServiceWorker()
|
||||
},
|
||||
unmounted () {
|
||||
window.removeEventListener('resize', this.updateMobileState)
|
||||
|
|
|
|||
|
|
@ -146,3 +146,5 @@ export function unregisterPushNotifications (token) {
|
|||
]).catch((e) => console.warn(`Failed to disable Web Push Notifications: ${e.message}`))
|
||||
}
|
||||
}
|
||||
|
||||
export { getOrCreateServiceWorker }
|
||||
|
|
|
|||
|
|
@ -143,4 +143,4 @@ self.addEventListener('notificationclick', (event) => {
|
|||
}))
|
||||
})
|
||||
|
||||
console.log('sw here')
|
||||
self.addEventListener('fetch', _ => _)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue