diff --git a/app/resources/js/app.js b/app/resources/js/app.js index ea63c94..8fc6d52 100755 --- a/app/resources/js/app.js +++ b/app/resources/js/app.js @@ -240,11 +240,16 @@ const app = new Vue({ } if (messageObject.author.username !== this.loggedInUser.username && messageObject.category._id !== this.selection.category._id) { - if (Notification.permission === 'granted') { - new Notification(`${messageObject.category.title}/${messageObject.author.username}`, messageObject.content); - } this.okNotification(`${messageObject.category.title}/${messageObject.author.username}: ${messageObject.content}`); } + + if (messageObject.author.username !== this.loggedInUser.username) { + if (Notification.permission === 'granted') { + new Notification(`${messageObject.category.title}/${messageObject.author.username}`, { + body: messageObject.content + }); + } + } }, openChatForCategory: async function(categoryId) { this.gateway.subscribeToCategoryChat(categoryId);