mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-22 11:38:57 +00:00
fix(desktop/chat) show the badge during receiving the mention in inactive section
This commit is contained in:
parent
db97fbf3eb
commit
0cc64774af
@ -286,8 +286,11 @@ method load*(
|
||||
# we do this only in case of chat section (not in case of communities)
|
||||
self.initContactRequestsModel()
|
||||
|
||||
for cModule in self.chatContentModules.values:
|
||||
let activeChatId = self.controller.getActiveChatId()
|
||||
for chatId, cModule in self.chatContentModules:
|
||||
cModule.load()
|
||||
if chatId == activeChatId:
|
||||
cModule.onMadeActive()
|
||||
|
||||
proc checkIfModuleDidLoad(self: Module) =
|
||||
if self.moduleLoaded:
|
||||
@ -357,15 +360,15 @@ method activeItemSubItemSet*(self: Module, itemId: string, subItemId: string) =
|
||||
self.view.chatsModel().setActiveItemSubItem(itemId, subItemId)
|
||||
self.view.activeItemSubItemSet(item, subItem)
|
||||
|
||||
# update child modules
|
||||
let activeChatId = self.controller.getActiveChatId()
|
||||
|
||||
# # update child modules
|
||||
for chatId, chatContentModule in self.chatContentModules:
|
||||
if chatId == self.controller.getActiveChatId():
|
||||
if chatId == activeChatId:
|
||||
chatContentModule.onMadeActive()
|
||||
else:
|
||||
chatContentModule.onMadeInactive()
|
||||
|
||||
let activeChatId = self.controller.getActiveChatId()
|
||||
|
||||
# save last open chat in settings for restore on the next app launch
|
||||
singletonInstance.localAccountSensitiveSettings.setSectionLastOpenChat(mySectionId, activeChatId)
|
||||
|
||||
|
@ -54,7 +54,7 @@ Item {
|
||||
readonly property var chatDetails: chatContentModule.chatDetails || null
|
||||
|
||||
function markAllMessagesReadIfMostRecentMessageIsInViewport() {
|
||||
if (!isMostRecentMessageInViewport) {
|
||||
if (!isMostRecentMessageInViewport || !chatLogView.visible) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -95,8 +95,17 @@ Item {
|
||||
}
|
||||
|
||||
function onHasUnreadMessagesChanged() {
|
||||
if (d.chatDetails.hasUnreadMessages && d.chatDetails.active && !d.isMostRecentMessageInViewport) {
|
||||
// HACK: we call it later because messages model may not be yet propagated with unread messages when this signal is emitted
|
||||
if (!d.chatDetails.hasUnreadMessages) {
|
||||
return
|
||||
}
|
||||
|
||||
// HACK: we call `addNewMessagesMarker` later because messages model
|
||||
// may not be yet propagated with unread messages when this signal is emitted
|
||||
if (chatLogView.visible) {
|
||||
if (!d.isMostRecentMessageInViewport) {
|
||||
Qt.callLater(() => messageStore.addNewMessagesMarker())
|
||||
}
|
||||
} else {
|
||||
Qt.callLater(() => messageStore.addNewMessagesMarker())
|
||||
}
|
||||
}
|
||||
@ -154,6 +163,8 @@ Item {
|
||||
|
||||
onCountChanged: d.markAllMessagesReadIfMostRecentMessageIsInViewport()
|
||||
|
||||
onVisibleChanged: d.markAllMessagesReadIfMostRecentMessageIsInViewport()
|
||||
|
||||
ScrollBar.vertical: StatusScrollBar {
|
||||
visible: chatLogView.visibleArea.heightRatio < 1
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user