[Glitch] Add missing rejection handling for Promises
Port missing parts from 2c51bc0ca5
to glitch-soc
This commit is contained in:
@@ -109,14 +109,11 @@ export function register () {
|
||||
pushNotificationsSetting.remove(me);
|
||||
}
|
||||
|
||||
try {
|
||||
getRegistration()
|
||||
.then(getPushSubscription)
|
||||
.then(unsubscribe);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
});
|
||||
return getRegistration()
|
||||
.then(getPushSubscription)
|
||||
.then(unsubscribe);
|
||||
})
|
||||
.catch(console.warn);
|
||||
} else {
|
||||
console.warn('Your browser does not support Web Push Notifications.');
|
||||
}
|
||||
@@ -137,6 +134,6 @@ export function saveSettings() {
|
||||
if (me) {
|
||||
pushNotificationsSetting.set(me, data);
|
||||
}
|
||||
});
|
||||
}).catch(console.warn);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user