Safari is stupid
This commit is contained in:
@@ -12,6 +12,7 @@ var serviceWorkerRegistrationMixin = {
|
||||
},
|
||||
methods: {
|
||||
registerPushListener: function() {
|
||||
try {
|
||||
const channel = new BroadcastChannel("updatePush");
|
||||
channel.addEventListener("message", event => {
|
||||
if (event.data.success) {
|
||||
@@ -19,6 +20,9 @@ var serviceWorkerRegistrationMixin = {
|
||||
this.$emit("push-allowed");
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("Using safari 'eh? No notifications for you.");
|
||||
}
|
||||
},
|
||||
sendMessage: function(message) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
@@ -25,8 +25,12 @@ self.addEventListener("message", event => {
|
||||
.then(subscription =>
|
||||
saveSubscription(subscription)
|
||||
.then(() => {
|
||||
try {
|
||||
const channel = new BroadcastChannel("updatePush");
|
||||
channel.postMessage({ success: true });
|
||||
} catch (e) {
|
||||
console.log("Using safari 'eh? No notifications for you.");
|
||||
}
|
||||
resolve();
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
Reference in New Issue
Block a user