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
}
rootStore: QtObject {
function isCommunityRequestPending(communityId) {
function isMyCommunityRequestPending(communityId) {
return communityId === "0x0006"
}
function cancelPendingRequest(communityId) {

View File

@ -13,6 +13,7 @@ SplitView {
property bool globalUtilsReady: false
property bool mainModuleReady: false
property bool communitiesModuleReady: false
Item {
@ -44,6 +45,9 @@ SplitView {
{colorId: 19, segmentLength: 2}])
}
function copyToClipboard(text) {
}
Component.onCompleted: {
Utils.globalUtilsInst = this
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 {
id: loader
active: globalUtilsReady && mainModuleReady
active: globalUtilsReady && mainModuleReady && communitiesModuleReady
anchors.fill: parent
sourceComponent: InviteFriendsToCommunityPopup {

View File

@ -54,8 +54,8 @@ StatusStackModal {
stackTitle: qsTr("Invite Contacts to %1").arg(community.name)
width: 640
height: d.popupContentHeight
padding: 0
leftPadding: 0
rightPadding: 0
@ -90,30 +90,17 @@ StatusStackModal {
}
stackItems: [
Item {
implicitHeight: d.popupContentHeight
ProfilePopupInviteFriendsPanel {
anchors.fill: parent
anchors.topMargin: 16
anchors.bottomMargin: 16
rootStore: root.rootStore
contactsStore: root.contactsStore
community: root.community
onPubKeysChanged: root.pubKeys = pubKeys
}
ProfilePopupInviteFriendsPanel {
rootStore: root.rootStore
contactsStore: root.contactsStore
community: root.community
onPubKeysChanged: root.pubKeys = pubKeys
},
Item {
ProfilePopupInviteMessagePanel {
anchors.fill: parent
anchors.topMargin: 16
contactsStore: root.contactsStore
pubKeys: root.pubKeys
onInviteMessageChanged: root.inviteMessage = inviteMessage
}
ProfilePopupInviteMessagePanel {
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 SortFilterProxyModel 0.2
QtObject {
id: root
@ -73,7 +75,13 @@ QtObject {
property bool walletMenuItemEnabled: profileStore.isWalletEnabled
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 ListModel mainMenuItems: ListModel {