diff --git a/ui/app/AppLayouts/Chat/popups/community/CommunitiesPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CommunitiesPopup.qml index 2580070edf..c269461b01 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CommunitiesPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CommunitiesPopup.qml @@ -113,26 +113,25 @@ StatusModal { return true } const lowerCaseSearchStr = searchBox.input.text.toLowerCase() - return name.toLowerCase().includes(lowerCaseSearchStr) || description.toLowerCase().includes(lowerCaseSearchStr) + return model.name.toLowerCase().includes(lowerCaseSearchStr) || model.description.toLowerCase().includes(lowerCaseSearchStr) } height: visible ? implicitHeight : 0 anchors.horizontalCenter: parent.horizontalCenter - title: name - subTitle: description - // TODO refactor members in the backend + title: model.name + subTitle: model.description //% "%1 members" - // tertiaryTitle: qsTrId("-1-members").arg(nbMembers) + tertiaryTitle: qsTrId("-1-members").arg(model.members.count) statusListItemTitle.font.weight: Font.Bold statusListItemTitle.font.pixelSize: 17 image.source: model.image - icon.isLetterIdenticon: !image - icon.background.color: color + icon.isLetterIdenticon: !model.image + icon.background.color: model.color || Theme.palette.primaryColor1 sensor.onClicked: { - if (joined && isMember) { - popup.setActiveCommunity(id); + if (model.joined && model.isMember) { + popup.setActiveCommunity(model.id); } else { - popup.setObservedCommunity(id); + popup.setObservedCommunity(model.id); Global.openPopup(communityDetailPopup) } popup.close() diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index ee80bffcc4..34a22f0380 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -25,6 +25,14 @@ QtObject { // Contact requests related part property var contactRequestsModel: chatCommunitySectionModule.contactRequestsModel + function setActiveCommunity(communityId) { + mainModule.setActiveSectionById(communityId); + } + + function setObservedCommunity(communityId) { + communitiesModuleInst.setObservedCommunity(communityId); + } + function acceptContactRequest(pubKey) { chatCommunitySectionModule.acceptContactRequest(pubKey) } diff --git a/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml b/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml index 350f5bbcae..bdc0fa0815 100644 --- a/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml @@ -369,13 +369,12 @@ Item { CommunitiesPopup { anchors.centerIn: parent communitiesList: root.store.communitiesList - // Not Refactored Yet -// onSetActiveCommunity: { -// root.store.chatsModelInst.communities.setActiveCommunity(id) -// } - onSetObservedCommunity: { - root.store.setObservedCommunity(id) - } + onSetActiveCommunity: { + root.store.setActiveCommunity(id) + } + onSetObservedCommunity: { + root.store.setObservedCommunity(id) + } onClosed: { destroy() } diff --git a/ui/app/AppLayouts/stores/RootStore.qml b/ui/app/AppLayouts/stores/RootStore.qml index 36969c8c8b..dd47716cce 100644 --- a/ui/app/AppLayouts/stores/RootStore.qml +++ b/ui/app/AppLayouts/stores/RootStore.qml @@ -35,10 +35,6 @@ QtObject { property real volume: !!localAccountSensitiveSettings ? localAccountSensitiveSettings.volume : 0.0 property bool notificationSoundsEnabled: !!localAccountSensitiveSettings ? localAccountSensitiveSettings.notificationSoundsEnabled : false - function setObservedCommunity(communityId) { - communitiesModuleInst.setObservedCommunity(communityId); - } - function createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { communitiesModuleInst.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); }