Fix error not showing up in failed push subscription
This commit is contained in:
parent
ff6d6e3e82
commit
80c11f2bde
@ -68,7 +68,7 @@ module.exports.initialize = () => {
|
|||||||
function onPushButton() {
|
function onPushButton() {
|
||||||
pushNotificationsButton.attr("disabled", true);
|
pushNotificationsButton.attr("disabled", true);
|
||||||
|
|
||||||
navigator.serviceWorker.ready.then((registration) => {
|
navigator.serviceWorker.ready.then((registration) =>
|
||||||
registration.pushManager.getSubscription().then((existingSubscription) => {
|
registration.pushManager.getSubscription().then((existingSubscription) => {
|
||||||
if (existingSubscription) {
|
if (existingSubscription) {
|
||||||
socket.emit("push:unregister");
|
socket.emit("push:unregister");
|
||||||
@ -100,9 +100,11 @@ function onPushButton() {
|
|||||||
if (successful) {
|
if (successful) {
|
||||||
alternatePushButton().removeAttr("disabled");
|
alternatePushButton().removeAttr("disabled");
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}).catch((err) => {
|
).catch((err) => {
|
||||||
$("#pushNotificationsUnsupported span").text(err).show();
|
$("#pushNotificationsUnsupported")
|
||||||
|
.find("span").text(`An error has occured: ${err}`).end()
|
||||||
|
.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user