fix: service worker types

This commit is contained in:
kolaente 2025-11-22 12:55:52 +01:00
parent a6d31dad08
commit 5b38a825e3
1 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,7 @@ import {useBaseStore} from '@/stores/base'
const baseStore = useBaseStore()
const updateAvailable = computed(() => baseStore.updateAvailable)
const registration = ref(null)
const registration = ref<ServiceWorkerRegistration | null>(null)
const refreshing = ref(false)
document.addEventListener('swUpdated', showRefreshUI, {once: true})
@ -38,7 +38,8 @@ navigator?.serviceWorker?.addEventListener(
function showRefreshUI(e: Event) {
console.log('recieved refresh event', e)
registration.value = e.detail
const customEvent = e as CustomEvent<ServiceWorkerRegistration>
registration.value = customEvent.detail
baseStore.setUpdateAvailable(true)
}