add try catch to notification
This commit is contained in:
parent
86ad93b318
commit
6d6c4ebb61
1 changed files with 8 additions and 3 deletions
|
@ -245,9 +245,14 @@ const app = new Vue({
|
||||||
|
|
||||||
if (messageObject.author.username !== this.loggedInUser.username) {
|
if (messageObject.author.username !== this.loggedInUser.username) {
|
||||||
if (Notification.permission === 'granted') {
|
if (Notification.permission === 'granted') {
|
||||||
|
try {
|
||||||
new Notification(`${messageObject.category.title}/${messageObject.author.username}`, {
|
new Notification(`${messageObject.category.title}/${messageObject.author.username}`, {
|
||||||
body: messageObject.content
|
body: messageObject.content
|
||||||
});
|
});
|
||||||
|
} catch(e) {
|
||||||
|
console.log('[E] [chat] Failed to show notification');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Reference in a new issue