diff --git a/src/components/VinlottisPage.vue b/src/components/VinlottisPage.vue index c4d071a..260c06c 100644 --- a/src/components/VinlottisPage.vue +++ b/src/components/VinlottisPage.vue @@ -73,6 +73,9 @@ export default { }, computed: { notificationAllowed: function() { + if (!("PushManager" in window)) { + return false; + } return ( Notification.permission !== "granted" || !this.pushAllowed || diff --git a/src/mixins/ServiceWorkerMixin.js b/src/mixins/ServiceWorkerMixin.js index d1af105..51f4e3e 100644 --- a/src/mixins/ServiceWorkerMixin.js +++ b/src/mixins/ServiceWorkerMixin.js @@ -4,8 +4,10 @@ var serviceWorkerRegistrationMixin = { console.log("Nettleseren din støtter ikke service-workers."); return; } - if (Notification.permission !== "granted") { - localStorage.removeItem("push"); + if ("PushManager" in window) { + if (Notification.permission !== "granted") { + localStorage.removeItem("push"); + } } this.registerPushListener(); this.registerServiceWorker();