This commit is contained in:
Xeovalyte 2022-10-01 13:25:56 +02:00
parent a6907c4c9e
commit aeb7ccae4f

View File

@ -42,13 +42,9 @@ onMounted(() => {
auth.value = getAuth() auth.value = getAuth()
if (process.client) { if (process.client) {
if (!window) return; if ('serviceWorker' in navigator && window.isSecureContext) {
window.addEventListener('load', () => { navigator.serviceWorker.register('/sw.js');
if (!('serviceWorker' in navigator)) {
throw new Error('serviceWorker is not supported in current browser!')
} }
navigator.serviceWorker.register('/sw.js')
})
} }
onAuthStateChanged(auth.value, async (usr) => { onAuthStateChanged(auth.value, async (usr) => {