fix(@desktop/chat): Fix showing groupchat image in a few places

Fix #7242
This commit is contained in:
Michal Iskierko 2022-09-07 12:03:51 +02:00 committed by Michał Iskierko
parent ad996d4884
commit 235e5e86ac
2 changed files with 7 additions and 11 deletions

View File

@ -66,13 +66,8 @@ StatusModal {
} }
} }
header.editable: !addMembers && popup.isAdmin header.editable: !addMembers && popup.isAdmin
header.asset.isLetterIdenticon: { header.asset.isLetterIdenticon: (popup.chatDetails.icon === "")
if (popup.chatDetails && popup.chatDetails.icon !== "") { header.asset.name: (popup.chatDetails.icon !== "") ? popup.chatDetails.icon : popup.chatDetails.name
return false
}
return true
}
header.asset.name: popup.chatDetails ? popup.chatDetails.name || popup.chatDetails.icon : ""
header.asset.isImage: (popup.chatDetails.icon !== "") header.asset.isImage: (popup.chatDetails.icon !== "")
header.asset.bgColor: popup.chatDetails ? popup.chatDetails.color : "transparent" header.asset.bgColor: popup.chatDetails ? popup.chatDetails.color : "transparent"

View File

@ -125,6 +125,7 @@ RowLayout {
chatDescription = chatContentModule.chatDetails.description chatDescription = chatContentModule.chatDetails.description
chatEmoji = chatContentModule.chatDetails.emoji chatEmoji = chatContentModule.chatDetails.emoji
chatColor = chatContentModule.chatDetails.color chatColor = chatContentModule.chatDetails.color
chatIcon = chatContentModule.chatDetails.icon
chatType = chatContentModule.chatDetails.type chatType = chatContentModule.chatDetails.type
chatMuted = chatContentModule.chatDetails.muted chatMuted = chatContentModule.chatDetails.muted
channelPosition = chatContentModule.chatDetails.position channelPosition = chatContentModule.chatDetails.position
@ -259,9 +260,7 @@ RowLayout {
case Constants.chatType.publicChat: case Constants.chatType.publicChat:
return qsTr("Public chat") return qsTr("Public chat")
case Constants.chatType.privateGroupChat: case Constants.chatType.privateGroupChat:
let cnt = root.usersStore.usersModule.model.count return qsTr("%n member(s)", "", chatContentModule.usersModule.model.count)
if(cnt > 1) return qsTr("%n member(s)", "", cnt);
return qsTr("1 member");
case Constants.chatType.communityChat: case Constants.chatType.communityChat:
return Utils.linkifyAndXSS(chatContentModule.chatDetails.description).trim() return Utils.linkifyAndXSS(chatContentModule.chatDetails.description).trim()
default: default:
@ -269,6 +268,8 @@ RowLayout {
} }
} }
asset.name: chatContentModule? chatContentModule.chatDetails.icon : "" 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 ? ringSettings.ringSpecModel: chatContentModule && chatContentModule.chatDetails.type === Constants.chatType.oneToOne ?
Utils.getColorHashAsJson(chatContentModule.chatDetails.id) : "" Utils.getColorHashAsJson(chatContentModule.chatDetails.id) : ""
asset.color: chatContentModule? asset.color: chatContentModule?
@ -289,7 +290,7 @@ RowLayout {
} }
Global.openPopup(pinnedMessagesPopupComponent, { Global.openPopup(pinnedMessagesPopupComponent, {
store: rootStore, store: rootStore,
messageStore: messageStore, messageStore: root.rootStore.messageStore,
pinnedMessagesModel: chatContentModule.pinnedMessagesModel, pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
messageToPin: "" messageToPin: ""
}) })