diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-02-10 21:28:29 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-02-10 21:44:14 +0100 |
commit | a963ea67dda17f69ed783b3fbcc91e5ce3858ad3 (patch) | |
tree | 86989e490ae6b7ed7460a4cb2345a48d56e5efcd /app/javascript/flavours/glitch/actions/push_notifications | |
parent | 6b2eefc7bf8cf1bb58da165d9594d9b17bf97e11 (diff) |
[Glitch] Add missing rejection handling for Promises
Port missing parts from 2c51bc0ca5a4c3a4bb140b4b40dabdda859ebb94 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/actions/push_notifications')
-rw-r--r-- | app/javascript/flavours/glitch/actions/push_notifications/registerer.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/app/javascript/flavours/glitch/actions/push_notifications/registerer.js b/app/javascript/flavours/glitch/actions/push_notifications/registerer.js index 91f442415..8fdb239f7 100644 --- a/app/javascript/flavours/glitch/actions/push_notifications/registerer.js +++ b/app/javascript/flavours/glitch/actions/push_notifications/registerer.js @@ -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); }; } |