fix(communities): Cannot leave community, invite, mute from Settings/Communities
This commit is contained in:
parent
168aae40da
commit
2fbc313e5a
|
@ -15,7 +15,9 @@ StatusListView {
|
|||
property bool hasAddedContacts: false
|
||||
|
||||
signal inviteFriends(var communityData)
|
||||
signal leaveCommunityClicked(var communityId)
|
||||
signal leaveCommunityClicked(string communityId)
|
||||
signal setCommunityMutedClicked(string communityId, bool muted)
|
||||
signal setActiveCommunityClicked(string communityId)
|
||||
|
||||
interactive: false
|
||||
implicitHeight: contentItem.childrenRect.height
|
||||
|
@ -36,6 +38,10 @@ StatusListView {
|
|||
|
||||
sensor.hoverEnabled: false
|
||||
|
||||
onClicked: {
|
||||
setActiveCommunityClicked(model.id)
|
||||
}
|
||||
|
||||
components: [
|
||||
StatusFlatButton {
|
||||
size: StatusBaseButton.Size.Small
|
||||
|
@ -55,7 +61,7 @@ StatusListView {
|
|||
height: 44
|
||||
icon.source: model.muted ? Style.svg("communities/notifications-muted")
|
||||
: Style.svg("communities/notifications")
|
||||
onClicked: root.communityProfileModule.setCommunityMuted(model.id, !model.muted)
|
||||
onClicked: root.setCommunityMutedClicked(model.id, !model.muted)
|
||||
},
|
||||
|
||||
StatusFlatRoundButton {
|
||||
|
@ -70,8 +76,10 @@ StatusListView {
|
|||
|
||||
property Component leaveCommunityPopup: StatusModal {
|
||||
id: leavePopup
|
||||
|
||||
property string community: ""
|
||||
property var communityId
|
||||
property string communityId: ""
|
||||
|
||||
anchors.centerIn: parent
|
||||
header.title: qsTr("Leave %1").arg(community)
|
||||
contentItem: Item {
|
||||
|
|
|
@ -55,14 +55,24 @@ SettingsContentBase {
|
|||
CommunitiesListPanel {
|
||||
width: parent.width
|
||||
model: root.profileSectionStore.communitiesList
|
||||
|
||||
onLeaveCommunityClicked: {
|
||||
root.profileSectionStore.communitiesProfileModule.leaveCommunity(leavePopup.communityId)
|
||||
root.profileSectionStore.communitiesProfileModule.leaveCommunity(communityId)
|
||||
}
|
||||
|
||||
onSetCommunityMutedClicked: {
|
||||
root.profileSectionStore.communitiesProfileModule.setCommunityMuted(communityId, muted)
|
||||
}
|
||||
|
||||
onSetActiveCommunityClicked: {
|
||||
rootStore.setActiveCommunity(communityId)
|
||||
}
|
||||
|
||||
onInviteFriends: {
|
||||
Global.openPopup(inviteFriendsToCommunityPopup, {
|
||||
community: communityData,
|
||||
hasAddedContacts: root.contactStore.myContactsModel.count > 0,
|
||||
communitySectionModule: communityProfileModule
|
||||
communitySectionModule: root.profileSectionStore.communitiesProfileModule
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +97,8 @@ SettingsContentBase {
|
|||
}
|
||||
|
||||
onSendInvites: {
|
||||
const error = communitySectionModule.inviteUsersToCommunity(communty.id, JSON.stringify(pubKeys))
|
||||
const error = root.profileSectionStore.communitiesProfileModule.inviteUsersToCommunity(
|
||||
community.id, JSON.stringify(pubKeys))
|
||||
processInviteResult(error)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,4 +166,8 @@ QtObject {
|
|||
mainModuleInst.setCurrentUserStatus(newStatus)
|
||||
}
|
||||
}
|
||||
|
||||
function setActiveCommunity(communityId) {
|
||||
mainModule.setActiveSectionById(communityId);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue