Merge pull request #2179 from mattermost/fix-droid

Fixing JS bug with droid
Этот коммит содержится в:
Corey Hulen
2016-02-17 10:23:25 -05:00
родитель def523b611 4b07624f11
Коммит 65c036d23a

Просмотреть файл

@@ -160,6 +160,7 @@ export function notifyMe(title, body, channel) {
} }
if (permission === 'granted') { if (permission === 'granted') {
try {
var notification = new Notification(title, {body, tag: body, icon: '/static/images/icon50x50.png'}); var notification = new Notification(title, {body, tag: body, icon: '/static/images/icon50x50.png'});
notification.onclick = () => { notification.onclick = () => {
window.focus(); window.focus();
@@ -172,6 +173,9 @@ export function notifyMe(title, body, channel) {
setTimeout(() => { setTimeout(() => {
notification.close(); notification.close();
}, 5000); }, 5000);
} catch (e) {
console.error(e); //eslint-disable-line no-console
}
} }
}); });
} }