Fix shift click leave group

This commit is contained in:
Natsumi
2025-06-23 23:57:50 +12:00
parent 2612ea38f0
commit 2237578441
3 changed files with 32 additions and 27 deletions

View File

@@ -920,6 +920,30 @@ export default class extends baseClass {
}
},
leaveGroup(groupId) {
groupRequest
.leaveGroup({
groupId
})
.then((args) => {
const groupId = args.params.groupId;
if (
this.groupDialog.visible &&
this.groupDialog.id === groupId
) {
this.groupDialog.inGroup = false;
this.getGroupDialogGroup(groupId);
}
if (
this.userDialog.visible &&
this.userDialog.id === this.currentUser.id &&
this.userDialog.representedGroup.id === groupId
) {
this.getCurrentUserRepresentedGroup();
}
});
},
leaveGroupPrompt(groupId) {
this.$confirm(
'Are you sure you want to leave this group?',
@@ -930,31 +954,7 @@ export default class extends baseClass {
type: 'info',
callback: (action) => {
if (action === 'confirm') {
groupRequest
.leaveGroup({
groupId
})
.then((args) => {
// API.$on('GROUP:LEAVE', function (args) {
const groupId = args.params.groupId;
if (
this.groupDialog.visible &&
this.groupDialog.id === groupId
) {
this.groupDialog.inGroup = false;
this.getGroupDialogGroup(groupId);
}
if (
this.userDialog.visible &&
this.userDialog.id ===
this.currentUser.id &&
this.userDialog.representedGroup.id ===
groupId
) {
this.getCurrentUserRepresentedGroup();
}
// });
});
this.leaveGroup(groupId);
}
}
}