Skip to content

Commit

Permalink
move removeMemberFromGroupChat to root store
Browse files Browse the repository at this point in the history
  • Loading branch information
iurimatias committed Sep 19, 2024
1 parent 68d7b20 commit 517e651
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ui/app/AppLayouts/Chat/panels/UserListPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ Item {
Global.blockContactRequested(publicKey, contactDetails)
}
onRemoveFromGroup: (publicKey) => {
const chatId = root.store.chatCommunitySectionModule.activeItem.id
root.store.chatCommunitySectionModule.removeMemberFromGroupChat("", chatId, publicKey)
root.store.removeMemberFromGroupChat(publicKey)
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions ui/app/AppLayouts/Chat/stores/RootStore.qml
Original file line number Diff line number Diff line change
Expand Up @@ -761,4 +761,9 @@ QtObject {
function updatePermissionsModel(communityId, sharedAddresses) {
communitiesModuleInst.checkPermissions(communityId, JSON.stringify(sharedAddresses))
}

function removeMemberFromGroupChat(publicKey) {
const chatId = chatCommunitySectionModule.activeItem.id
chatCommunitySectionModule.removeMemberFromGroupChat("", chatId, publicKey)
}
}
3 changes: 1 addition & 2 deletions ui/imports/shared/views/chat/MessageView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1217,8 +1217,7 @@ Loader {
Global.blockContactRequested(publicKey, contactDetails)
}
onRemoveFromGroup: (publicKey) => {
const chatId = root.rootStore.chatCommunitySectionModule.activeItem.id
root.rootStore.chatCommunitySectionModule.removeMemberFromGroupChat("", chatId, publicKey)
root.store.removeMemberFromGroupChat(publicKey)
}
onOpened: {
root.setMessageActive(root.messageId, true)
Expand Down

0 comments on commit 517e651

Please sign in to comment.