fix(@desktop/community): Fix member icons in invite friends panel

Fix #7364
This commit is contained in:
Michal Iskierko 2022-09-16 10:30:08 +02:00 committed by Michał Iskierko
parent d7cfa3318c
commit a0c145fbfc
4 changed files with 16 additions and 6 deletions

View File

@ -50,8 +50,10 @@ ColumnLayout {
ExistingContacts {
id: existingContacts
rootStore: root.rootStore
contactsStore: root.contactsStore
community: root.community
communityId: root.community.id
hideCommunityMembers: true
showCheckbox: true
filterText: filterInput.text

View File

@ -112,6 +112,11 @@ QtObject {
historyArchiveSupportEnabled, pinMessagesAllowedForMembers, bannerJsonStr);
}
function communityHasMember(communityId, pubKey)
{
return communitiesModuleInst.isMemberOfCommunity(communityId, pubKey)
}
function copyToClipboard(text) {
globalUtils.copyToClipboard(text)
}

View File

@ -185,8 +185,10 @@ Item {
ExistingContacts {
id: existingContacts
rootStore: root.rootStore
contactsStore: root.contactsStore
community: root.community
communityId: root.community.id
visible: showContactList
hideCommunityMembers: root.hideCommunityMembers
showCheckbox: root.showCheckbox

View File

@ -16,8 +16,9 @@ import AppLayouts.Chat.controls 1.0
Item {
id: root
property var rootStore
property var contactsStore
property var community
property string communityId
property string filterText: ""
property bool expanded: true
@ -54,8 +55,8 @@ Item {
color: sensor.containsMouse ? Style.current.backgroundHover : Style.current.transparent
userName: model.displayName
asset.name: model.icon
asset.isImage: true
asset.imgIsIdenticon: false
asset.isImage: (asset.name !== "")
asset.isLetterIdenticon: (asset.name === "")
asset.width: 40
asset.height: 40
asset.color: Utils.colorForColorId(model.colorId)
@ -75,7 +76,7 @@ Item {
model.localNickname.toLowerCase().includes(root.filterText.toLowerCase()) ||
model.pubKey.toLowerCase().includes(root.filterText.toLowerCase())) &&
(!root.hideCommunityMembers ||
!root.community.hasMember(model.pubKey));
!root.rootStore.communityHasMember(model.pubKey, root.communityId));
}
onClicked: {