fix: make sure admin status is up to date when opening the popup

This commit is contained in:
Jonathan Rainville 2020-10-20 15:46:49 -04:00 committed by Iuri Matias
parent fc4a179dc7
commit 6906ddcb61
1 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@ ModalPopup {
property int memberCount: 1
readonly property int maxMembers: 10
property var pubKeys: []
property bool isAdmin: false
function resetSelectedMembers(){
pubKeys = [];
@ -36,6 +37,7 @@ ModalPopup {
onOpened: {
addMembers = false;
popup.isAdmin = chatsModel.activeChannel.isAdmin(profileModel.profile.pubKey)
btnSelectMembers.enabled = false;
resetSelectedMembers();
}
@ -98,7 +100,7 @@ ModalPopup {
Rectangle {
id: editGroupNameBtn
visible: !addMembers && chatsModel.activeChannel.isAdmin(profileModel.profile.pubKey)
visible: !addMembers && popup.isAdmin
height: 24
width: 24
anchors.verticalCenter: groupName.verticalCenter
@ -307,7 +309,7 @@ ModalPopup {
StyledText {
id: moreActionsBtn
visible: !model.isAdmin && chatsModel.activeChannel.isAdmin(profileModel.profile.pubKey)
visible: !model.isAdmin && popup.isAdmin
text: "..."
anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding
@ -341,7 +343,7 @@ ModalPopup {
}
footer: Item {
visible: chatsModel.activeChannel.isAdmin(profileModel.profile.pubKey)
visible: popup.isAdmin
width: parent.width
height: children[0].height
StyledButton {