forked from hippoz/brainlet
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 (Notification.permission === 'granted') {
|
||||
new Notification(`${messageObject.category.title}/${messageObject.author.username}`, {
|
||||
body: messageObject.content
|
||||
});
|
||||
try {
|
||||
new Notification(`${messageObject.category.title}/${messageObject.author.username}`, {
|
||||
body: messageObject.content
|
||||
});
|
||||
} catch(e) {
|
||||
console.log('[E] [chat] Failed to show notification');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue