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()
if (process.client) {
if (!window) return;
window.addEventListener('load', () => {
if (!('serviceWorker' in navigator)) {
throw new Error('serviceWorker is not supported in current browser!')
if ('serviceWorker' in navigator && window.isSecureContext) {
navigator.serviceWorker.register('/sw.js');
}
navigator.serviceWorker.register('/sw.js')
})
}
onAuthStateChanged(auth.value, async (usr) => {