diff options
author | Corey Hulen <corey@hulen.com> | 2016-02-17 10:23:25 -0500 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-02-17 10:23:25 -0500 |
commit | 65c036d23a4cc4795ccb303dd44f8251ed6d4b03 (patch) | |
tree | d65eef421b0eb27f053be12872e09c518947bc8c | |
parent | def523b611809f6cda7ad716420f228bb86c924c (diff) | |
parent | 4b07624f11c5f260bc0231a5e3d6b1a0acafcc48 (diff) | |
download | chat-65c036d23a4cc4795ccb303dd44f8251ed6d4b03.tar.gz chat-65c036d23a4cc4795ccb303dd44f8251ed6d4b03.tar.bz2 chat-65c036d23a4cc4795ccb303dd44f8251ed6d4b03.zip |
Merge pull request #2179 from mattermost/fix-droid
Fixing JS bug with droid
-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 bdf68fc03..2b946d81f 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 + } } }); } |