Removing notifications completely from safari

This commit is contained in:
Kasper Rynning-Tønnesen
2020-02-21 15:47:10 +01:00
parent 7299056369
commit 68a0700f7f
2 changed files with 7 additions and 2 deletions

View File

@@ -73,6 +73,9 @@ export default {
}, },
computed: { computed: {
notificationAllowed: function() { notificationAllowed: function() {
if (!("PushManager" in window)) {
return false;
}
return ( return (
Notification.permission !== "granted" || Notification.permission !== "granted" ||
!this.pushAllowed || !this.pushAllowed ||

View File

@@ -4,9 +4,11 @@ var serviceWorkerRegistrationMixin = {
console.log("Nettleseren din støtter ikke service-workers."); console.log("Nettleseren din støtter ikke service-workers.");
return; return;
} }
if ("PushManager" in window) {
if (Notification.permission !== "granted") { if (Notification.permission !== "granted") {
localStorage.removeItem("push"); localStorage.removeItem("push");
} }
}
this.registerPushListener(); this.registerPushListener();
this.registerServiceWorker(); this.registerServiceWorker();
}, },