From a963ea67dda17f69ed783b3fbcc91e5ce3858ad3 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 10 Feb 2019 21:28:29 +0100 Subject: [Glitch] Add missing rejection handling for Promises Port missing parts from 2c51bc0ca5a4c3a4bb140b4b40dabdda859ebb94 to glitch-soc --- .../glitch/actions/push_notifications/registerer.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'app/javascript/flavours/glitch/actions/push_notifications') 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); }; } -- cgit