fix(ChatHeaderContentView): reflect nickname changes in 1-1 chat

Fixes #8303
This commit is contained in:
Lukáš Tinkl 2022-11-17 10:55:49 +01:00 committed by Lukáš Tinkl
parent f022e02efe
commit 6e5b98d157
2 changed files with 2 additions and 13 deletions

View File

@ -334,7 +334,7 @@ method onContactDetailsUpdated*(self: Module, contactId: string) =
item.messageContainsMentions = m.containsContactMentions() item.messageContainsMentions = m.containsContactMentions()
if(self.controller.getMyChatId() == contactId): if(self.controller.getMyChatId() == contactId):
self.view.updateChatDetailsNameAndIcon(updatedContact.details.displayName, updatedContact.icon) self.view.updateChatDetailsNameAndIcon(updatedContact.defaultDisplayName, updatedContact.icon)
self.view.updateTrustStatus(updatedContact.details.trustStatus == TrustStatus.Untrustworthy) self.view.updateTrustStatus(updatedContact.details.trustStatus == TrustStatus.Untrustworthy)
method onNotificationsUpdated*(self: Module, hasUnreadMessages: bool, notificationCount: int) = method onNotificationsUpdated*(self: Module, hasUnreadMessages: bool, notificationCount: int) =

View File

@ -267,18 +267,7 @@ Item {
readonly property string emojiIcon: chatContentModule? chatContentModule.chatDetails.emoji : "" // Needed for test readonly property string emojiIcon: chatContentModule? chatContentModule.chatDetails.emoji : "" // Needed for test
objectName: "chatInfoBtnInHeader" objectName: "chatInfoBtnInHeader"
title: { title: chatContentModule? chatContentModule.chatDetails.name : ""
const module = root.rootStore.currentChatContentModule()
if(!module)
return ""
if (module.chatDetails.type === Constants.chatType.oneToOne) {
const d = Utils.getContactDetailsAsJson(module.chatDetails.id)
if (!!d.displayName)
return d.displayName
}
return module.chatDetails.name
}
subTitle: { subTitle: {
if(!chatContentModule) if(!chatContentModule)