diff --git a/src/app/modules/main/chat_section/module.nim b/src/app/modules/main/chat_section/module.nim index 5f6e1f614a..62590b8533 100644 --- a/src/app/modules/main/chat_section/module.nim +++ b/src/app/modules/main/chat_section/module.nim @@ -350,7 +350,8 @@ proc updateNotifications(self: Module, chatId: string, unviewedMessagesCount: in # update model of this module (appropriate chat from the chats list (chats model)) self.view.chatsModel().updateNotificationsForItemOrSubItemById(chatId, hasUnreadMessages, unviewedMentionsCount) # update child module - self.chatContentModules[chatId].onNotificationsUpdated(hasUnreadMessages, unviewedMentionsCount) + if (self.chatContentModules.contains(chatId)): + self.chatContentModules[chatId].onNotificationsUpdated(hasUnreadMessages, unviewedMentionsCount) # update parent module let (sectionHasUnreadMessages, sectionNotificationCount) = self.view.chatsModel().getAllNotifications() self.delegate.onNotificationsUpdated(self.controller.getMySectionId(), sectionHasUnreadMessages, sectionNotificationCount) @@ -420,4 +421,4 @@ method onNewMessagesReceived*(self: Module, chatId: string, unviewedMessagesCoun if(activeChatId == chatId): self.controller.markAllMessagesRead(chatId) else: - self.updateNotifications(chatId, unviewedMessagesCount, unviewedMentionsCount) \ No newline at end of file + self.updateNotifications(chatId, unviewedMessagesCount, unviewedMentionsCount)