From 9fdc2e376837f6243249268c94b34e4b046ce923 Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Wed, 15 Apr 2026 10:43:52 +0000 Subject: [PATCH] fix minor bug with notification handling --- dist/index.js | 4 +++- src/Model/Chat/chatModel.ts | 2 +- src/ViewModel/Global/notificationViewModel.ts | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index c77d6f20..5903cdd3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1255,7 +1255,8 @@ if (chatMessage == null) return; chatMessage.status = "received" /* Received */; this.addMessage(chatMessage); - if (chatMessage.stringifiedFile != void 0) return; + console.log("MESSAGE", chatMessage.stringifiedFile); + if (chatMessage.stringifiedFile) return; this.setReadStatus(true); }; this.handleReaction = (reaction) => { @@ -3762,6 +3763,7 @@ this.showNotification = (message) => { const notification = _NotificationViewModel.createNotification(message); if (this.seenMessageIds.has(message.id)) return; + if (this.chatListViewModel.selectedChat.value == void 0) return; const currentChat = this.chatListViewModel.selectedChat.value.chatModel.info.primaryChannel; const currentPage = this.chatListViewModel.selectedChat.value.selectedPage.value; if (notification.chat == currentChat && currentPage == "messages" /* Messages */) diff --git a/src/Model/Chat/chatModel.ts b/src/Model/Chat/chatModel.ts index b235e7d0..8e461db6 100644 --- a/src/Model/Chat/chatModel.ts +++ b/src/Model/Chat/chatModel.ts @@ -103,7 +103,7 @@ export default class ChatModel { this.addMessage(chatMessage); - if (chatMessage.stringifiedFile != undefined) return; + if (chatMessage.stringifiedFile) return; this.setReadStatus(true); }; diff --git a/src/ViewModel/Global/notificationViewModel.ts b/src/ViewModel/Global/notificationViewModel.ts index 5616ce9d..3abee98a 100644 --- a/src/ViewModel/Global/notificationViewModel.ts +++ b/src/ViewModel/Global/notificationViewModel.ts @@ -17,6 +17,8 @@ export default class NotificationViewModel { NotificationViewModel.createNotification(message); if (this.seenMessageIds.has(message.id)) return; + if (this.chatListViewModel.selectedChat.value == undefined) return; + const currentChat = this.chatListViewModel.selectedChat.value.chatModel.info .primaryChannel;