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: {
notificationAllowed: function() {
if (!("PushManager" in window)) {
return false;
}
return (
Notification.permission !== "granted" ||
!this.pushAllowed ||

View File

@@ -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();