fix(CommunitiesView): display proper member count

turns out the model from the comminitiesModule doesn't contain the
members; use the sectionModel (as in all other places) instead which
already has the correct info

additionally, fix the InviteFriendsToCommunityPopup display, it appeared
empty all the time

Fixes #12967
This commit is contained in:
Lukáš Tinkl 2023-12-11 10:47:30 +01:00 committed by Lukáš Tinkl
parent 50bad5539b
commit 80975c80a2
4 changed files with 40 additions and 26 deletions

View File

@ -155,7 +155,7 @@ SplitView {
property var communitiesList: ctrlEmptyView.checked ? emptyModel : communitiesModel property var communitiesList: ctrlEmptyView.checked ? emptyModel : communitiesModel
} }
rootStore: QtObject { rootStore: QtObject {
function isCommunityRequestPending(communityId) { function isMyCommunityRequestPending(communityId) {
return communityId === "0x0006" return communityId === "0x0006"
} }
function cancelPendingRequest(communityId) { function cancelPendingRequest(communityId) {

View File

@ -13,6 +13,7 @@ SplitView {
property bool globalUtilsReady: false property bool globalUtilsReady: false
property bool mainModuleReady: false property bool mainModuleReady: false
property bool communitiesModuleReady: false
Item { Item {
@ -44,6 +45,9 @@ SplitView {
{colorId: 19, segmentLength: 2}]) {colorId: 19, segmentLength: 2}])
} }
function copyToClipboard(text) {
}
Component.onCompleted: { Component.onCompleted: {
Utils.globalUtilsInst = this Utils.globalUtilsInst = this
globalUtilsReady = true globalUtilsReady = true
@ -70,9 +74,24 @@ SplitView {
} }
} }
QtObject {
function shareCommunityUrlWithData(communityId) {
return "status-app:/"+communityId
}
Component.onCompleted: {
communitiesModuleReady = true
Utils.communitiesModuleInst = this
}
Component.onDestruction: {
communitiesModuleReady = false
Utils.communitiesModuleInst = {}
}
}
Loader { Loader {
id: loader id: loader
active: globalUtilsReady && mainModuleReady active: globalUtilsReady && mainModuleReady && communitiesModuleReady
anchors.fill: parent anchors.fill: parent
sourceComponent: InviteFriendsToCommunityPopup { sourceComponent: InviteFriendsToCommunityPopup {

View File

@ -54,8 +54,8 @@ StatusStackModal {
stackTitle: qsTr("Invite Contacts to %1").arg(community.name) stackTitle: qsTr("Invite Contacts to %1").arg(community.name)
width: 640 width: 640
height: d.popupContentHeight
padding: 0
leftPadding: 0 leftPadding: 0
rightPadding: 0 rightPadding: 0
@ -90,30 +90,17 @@ StatusStackModal {
} }
stackItems: [ stackItems: [
Item { ProfilePopupInviteFriendsPanel {
implicitHeight: d.popupContentHeight rootStore: root.rootStore
contactsStore: root.contactsStore
ProfilePopupInviteFriendsPanel { community: root.community
anchors.fill: parent onPubKeysChanged: root.pubKeys = pubKeys
anchors.topMargin: 16
anchors.bottomMargin: 16
rootStore: root.rootStore
contactsStore: root.contactsStore
community: root.community
onPubKeysChanged: root.pubKeys = pubKeys
}
}, },
Item { ProfilePopupInviteMessagePanel {
ProfilePopupInviteMessagePanel { contactsStore: root.contactsStore
anchors.fill: parent pubKeys: root.pubKeys
anchors.topMargin: 16 onInviteMessageChanged: root.inviteMessage = inviteMessage
contactsStore: root.contactsStore
pubKeys: root.pubKeys
onInviteMessageChanged: root.inviteMessage = inviteMessage
}
} }
] ]
} }

View File

@ -3,6 +3,8 @@ import utils 1.0
import AppLayouts.Chat.stores 1.0 import AppLayouts.Chat.stores 1.0
import SortFilterProxyModel 0.2
QtObject { QtObject {
id: root id: root
@ -73,7 +75,13 @@ QtObject {
property bool walletMenuItemEnabled: profileStore.isWalletEnabled property bool walletMenuItemEnabled: profileStore.isWalletEnabled
property var communitiesModuleInst: Global.appIsReady? communitiesModule : null property var communitiesModuleInst: Global.appIsReady? communitiesModule : null
property var communitiesList: !!communitiesModuleInst? communitiesModuleInst.model : null property var communitiesList: SortFilterProxyModel {
sourceModel: root.mainModuleInst.sectionsModel
filters: ValueFilter {
roleName: "sectionType"
value: Constants.appSection.community
}
}
property var communitiesProfileModule: profileSectionModuleInst.communitiesModule property var communitiesProfileModule: profileSectionModuleInst.communitiesModule
property ListModel mainMenuItems: ListModel { property ListModel mainMenuItems: ListModel {