Not crashing when not supplying push-data thingies
This commit is contained in:
@@ -4,7 +4,7 @@ var serviceWorkerRegistrationMixin = {
|
||||
console.log("Nettleseren din støtter ikke service-workers.");
|
||||
return;
|
||||
}
|
||||
if ("PushManager" in window) {
|
||||
if ("PushManager" in window && __PUSHENABLED__) {
|
||||
if (Notification.permission !== "granted") {
|
||||
localStorage.removeItem("push");
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ self.addEventListener("activate", event => {
|
||||
});
|
||||
|
||||
self.addEventListener("message", event => {
|
||||
if (!__PUBLICKEY__) {
|
||||
return;
|
||||
}
|
||||
if (event.data === "updatePush") {
|
||||
event.waitUntil(
|
||||
new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user