Fixed app crashing on start up

Also partially fixes #4444
This commit is contained in:
Alexandra Betouni 2022-01-13 22:23:07 +02:00 committed by Sale Djenic
parent f7e8b68715
commit a694b15d6c
1 changed files with 3 additions and 2 deletions

View File

@ -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)
self.updateNotifications(chatId, unviewedMessagesCount, unviewedMentionsCount)