about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions/push_notifications/registerer.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-02-12 20:29:55 +0100
committerGitHub <noreply@github.com>2019-02-12 20:29:55 +0100
commita3ba28eb17d75af37396359e8c37675e06605ccf (patch)
tree20d81ffc7b01b132e1683685a0176ede6374c13c /app/javascript/flavours/glitch/actions/push_notifications/registerer.js
parentb89e003c4d049d64d2d4015357b8b931370bc5f0 (diff)
parentb47a53f90299a1fb52423aacbc0c23427e2eb132 (diff)
Merge pull request #913 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/actions/push_notifications/registerer.js')
-rw-r--r--app/javascript/flavours/glitch/actions/push_notifications/registerer.js15
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);
   };
 }