From 6e5b98d1577cb957b45286c01500a19e2f90ca05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Thu, 17 Nov 2022 10:55:49 +0100 Subject: [PATCH] fix(ChatHeaderContentView): reflect nickname changes in 1-1 chat Fixes #8303 --- .../main/chat_section/chat_content/module.nim | 2 +- .../AppLayouts/Chat/views/ChatHeaderContentView.qml | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/app/modules/main/chat_section/chat_content/module.nim b/src/app/modules/main/chat_section/chat_content/module.nim index 2a9c2b6cf4..fab6ce8049 100644 --- a/src/app/modules/main/chat_section/chat_content/module.nim +++ b/src/app/modules/main/chat_section/chat_content/module.nim @@ -334,7 +334,7 @@ method onContactDetailsUpdated*(self: Module, contactId: string) = item.messageContainsMentions = m.containsContactMentions() 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) method onNotificationsUpdated*(self: Module, hasUnreadMessages: bool, notificationCount: int) = diff --git a/ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml b/ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml index 2f30e03f0d..7ea9d3b4b8 100644 --- a/ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml @@ -267,18 +267,7 @@ Item { readonly property string emojiIcon: chatContentModule? chatContentModule.chatDetails.emoji : "" // Needed for test objectName: "chatInfoBtnInHeader" - title: { - 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 - } + title: chatContentModule? chatContentModule.chatDetails.name : "" subTitle: { if(!chatContentModule)