diff options
author | =Corey Hulen <corey@hulen.com> | 2016-02-17 09:59:55 -0500 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-02-17 09:59:55 -0500 |
commit | 4b07624f11c5f260bc0231a5e3d6b1a0acafcc48 (patch) | |
tree | 654d743e7287a9400943fb09c372445edeaa4ee7 /web/react/utils/utils.jsx | |
parent | 2ec3762fb2e0140649d138006323b35726b9b213 (diff) | |
download | chat-4b07624f11c5f260bc0231a5e3d6b1a0acafcc48.tar.gz chat-4b07624f11c5f260bc0231a5e3d6b1a0acafcc48.tar.bz2 chat-4b07624f11c5f260bc0231a5e3d6b1a0acafcc48.zip |
Fixing JS bug with droid
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 7f124149d..e310dc108 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -160,18 +160,22 @@ export function notifyMe(title, body, channel) { } if (permission === 'granted') { - var notification = new Notification(title, {body, tag: body, icon: '/static/images/icon50x50.png'}); - notification.onclick = () => { - window.focus(); - if (channel) { - switchChannel(channel); - } else { - window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square'; - } - }; - setTimeout(() => { - notification.close(); - }, 5000); + try { + var notification = new Notification(title, {body, tag: body, icon: '/static/images/icon50x50.png'}); + notification.onclick = () => { + window.focus(); + if (channel) { + switchChannel(channel); + } else { + window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square'; + } + }; + setTimeout(() => { + notification.close(); + }, 5000); + } catch (e) { + console.error(e); //eslint-disable-line no-console + } } }); } |