From a659063fc29cfa57a08e0988d3a64de07d3df378 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 25 Aug 2026 21:30:21 +0300 Subject: [PATCH] fix chat notifications --- src/services/chat_utils/chat_utils.js | 3 ++- src/stores/chats.js | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/services/chat_utils/chat_utils.js b/src/services/chat_utils/chat_utils.js index d99c17ed8..a5c0d67cd 100644 --- a/src/services/chat_utils/chat_utils.js +++ b/src/services/chat_utils/chat_utils.js @@ -11,13 +11,14 @@ export const maybeShowChatNotification = (chat) => { title: chat.account.name, icon: chat.account.profile_image_url, body: chat.lastMessage.content, + type: 'chatMention', } if (chat.lastMessage.attachment?.type === 'image') { opts.image = chat.lastMessage.attachment.preview_url } - showDesktopNotification(window.vuex.state, opts) + showDesktopNotification(opts) } export const buildFakeMessage = ({ diff --git a/src/stores/chats.js b/src/stores/chats.js index 47e08b738..82bb638dd 100644 --- a/src/stores/chats.js +++ b/src/stores/chats.js @@ -86,9 +86,6 @@ export const useChatsStore = defineStore('chats', { chat.lastMessage = updatedChat.lastMessage chat.unread = updatedChat.unread chat.updated_at = updatedChat.updated_at - if (isNewMessage && chat.unread) { - maybeShowChatNotification(chat) - } } else { this.chatList.data.push(updatedChat) this.chatList.idStore[updatedChat.id] = updatedChat @@ -107,10 +104,10 @@ export const useChatsStore = defineStore('chats', { chat.lastMessage = updatedChat.lastMessage chat.unread = updatedChat.unread chat.updated_at = updatedChat.updated_at - } - if (!chat) { + } else { this.chatList.data.unshift(updatedChat) } + maybeShowChatNotification(chat) this.chatList.idStore[updatedChat.id] = updatedChat }, deleteChat(id) {