From 86ad93b3186488f7debb29c1d9245cbf2204e6c1 Mon Sep 17 00:00:00 2001 From: hippoz Date: Fri, 20 Nov 2020 22:10:42 +0200 Subject: [PATCH] fix notifications (?) --- app/resources/js/app.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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);