|
|
@ -48,7 +48,6 @@ export function register () {
|
|
|
|
|
|
|
|
|
|
|
|
if (supportsPushNotifications) {
|
|
|
|
if (supportsPushNotifications) {
|
|
|
|
if (!getApplicationServerKey()) {
|
|
|
|
if (!getApplicationServerKey()) {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
|
|
|
console.error('The VAPID public key is not set. You will not be able to receive Web Push Notifications.');
|
|
|
|
console.error('The VAPID public key is not set. You will not be able to receive Web Push Notifications.');
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -84,10 +83,8 @@ export function register () {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
.catch(error => {
|
|
|
|
if (error.code === 20 && error.name === 'AbortError') {
|
|
|
|
if (error.code === 20 && error.name === 'AbortError') {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
|
|
|
console.warn('Your browser supports Web Push Notifications, but does not seem to implement the VAPID protocol.');
|
|
|
|
console.warn('Your browser supports Web Push Notifications, but does not seem to implement the VAPID protocol.');
|
|
|
|
} else if (error.code === 5 && error.name === 'InvalidCharacterError') {
|
|
|
|
} else if (error.code === 5 && error.name === 'InvalidCharacterError') {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
|
|
|
console.error('The VAPID public key seems to be invalid:', getApplicationServerKey());
|
|
|
|
console.error('The VAPID public key seems to be invalid:', getApplicationServerKey());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -103,7 +100,6 @@ export function register () {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
|
|
|
console.warn('Your browser does not support Web Push Notifications.');
|
|
|
|
console.warn('Your browser does not support Web Push Notifications.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|