From 235e5e86ac883f49ea320c6c9310776a318217b9 Mon Sep 17 00:00:00 2001 From: Michal Iskierko Date: Wed, 7 Sep 2022 12:03:51 +0200 Subject: [PATCH] fix(@desktop/chat): Fix showing groupchat image in a few places Fix #7242 --- ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml | 9 ++------- ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml | 9 +++++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml b/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml index ebb2f564b8..a300d1f0c4 100644 --- a/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml @@ -66,13 +66,8 @@ StatusModal { } } header.editable: !addMembers && popup.isAdmin - header.asset.isLetterIdenticon: { - if (popup.chatDetails && popup.chatDetails.icon !== "") { - return false - } - return true - } - header.asset.name: popup.chatDetails ? popup.chatDetails.name || popup.chatDetails.icon : "" + header.asset.isLetterIdenticon: (popup.chatDetails.icon === "") + header.asset.name: (popup.chatDetails.icon !== "") ? popup.chatDetails.icon : popup.chatDetails.name header.asset.isImage: (popup.chatDetails.icon !== "") header.asset.bgColor: popup.chatDetails ? popup.chatDetails.color : "transparent" diff --git a/ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml b/ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml index ee89606b73..6d9e6a9970 100644 --- a/ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml @@ -125,6 +125,7 @@ RowLayout { chatDescription = chatContentModule.chatDetails.description chatEmoji = chatContentModule.chatDetails.emoji chatColor = chatContentModule.chatDetails.color + chatIcon = chatContentModule.chatDetails.icon chatType = chatContentModule.chatDetails.type chatMuted = chatContentModule.chatDetails.muted channelPosition = chatContentModule.chatDetails.position @@ -259,9 +260,7 @@ RowLayout { case Constants.chatType.publicChat: return qsTr("Public chat") case Constants.chatType.privateGroupChat: - let cnt = root.usersStore.usersModule.model.count - if(cnt > 1) return qsTr("%n member(s)", "", cnt); - return qsTr("1 member"); + return qsTr("%n member(s)", "", chatContentModule.usersModule.model.count) case Constants.chatType.communityChat: return Utils.linkifyAndXSS(chatContentModule.chatDetails.description).trim() default: @@ -269,6 +268,8 @@ RowLayout { } } asset.name: chatContentModule? chatContentModule.chatDetails.icon : "" + asset.isImage: chatContentModule.chatDetails.icon !== "" + asset.isLetterIdenticon: chatContentModule.chatDetails.icon === "" ringSettings.ringSpecModel: chatContentModule && chatContentModule.chatDetails.type === Constants.chatType.oneToOne ? Utils.getColorHashAsJson(chatContentModule.chatDetails.id) : "" asset.color: chatContentModule? @@ -289,7 +290,7 @@ RowLayout { } Global.openPopup(pinnedMessagesPopupComponent, { store: rootStore, - messageStore: messageStore, + messageStore: root.rootStore.messageStore, pinnedMessagesModel: chatContentModule.pinnedMessagesModel, messageToPin: "" })