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
+16 -16
View File
@@ -920,22 +920,12 @@ export default class extends baseClass {
} }
}, },
leaveGroupPrompt(groupId) { leaveGroup(groupId) {
this.$confirm(
'Are you sure you want to leave this group?',
'Confirm',
{
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'info',
callback: (action) => {
if (action === 'confirm') {
groupRequest groupRequest
.leaveGroup({ .leaveGroup({
groupId groupId
}) })
.then((args) => { .then((args) => {
// API.$on('GROUP:LEAVE', function (args) {
const groupId = args.params.groupId; const groupId = args.params.groupId;
if ( if (
this.groupDialog.visible && this.groupDialog.visible &&
@@ -946,15 +936,25 @@ export default class extends baseClass {
} }
if ( if (
this.userDialog.visible && this.userDialog.visible &&
this.userDialog.id === this.userDialog.id === this.currentUser.id &&
this.currentUser.id && this.userDialog.representedGroup.id === groupId
this.userDialog.representedGroup.id ===
groupId
) { ) {
this.getCurrentUserRepresentedGroup(); this.getCurrentUserRepresentedGroup();
} }
// });
}); });
},
leaveGroupPrompt(groupId) {
this.$confirm(
'Are you sure you want to leave this group?',
'Confirm',
{
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'info',
callback: (action) => {
if (action === 'confirm') {
this.leaveGroup(groupId);
} }
} }
} }
@@ -1325,7 +1325,7 @@
icon="el-icon-close" icon="el-icon-close"
circle circle
style="color: #f56c6c; margin-left: 5px" style="color: #f56c6c; margin-left: 5px"
@click.stop="leaveGroupPrompt(group.id)"> @click.stop="leaveGroup(group.id)">
</el-button> </el-button>
<el-button <el-button
v-else v-else
@@ -2054,6 +2054,7 @@
'refreshUserDialogTreeData', 'refreshUserDialogTreeData',
'saveUserMemo', 'saveUserMemo',
'setGroupVisibility', 'setGroupVisibility',
'leaveGroup',
'leaveGroupPrompt', 'leaveGroupPrompt',
'refreshGalleryTable', 'refreshGalleryTable',
'refreshVRCPlusIconsTable', 'refreshVRCPlusIconsTable',
@@ -3170,7 +3171,7 @@
// Leave (remove user from) all selected groups // Leave (remove user from) all selected groups
function bulkLeaveGroups() { function bulkLeaveGroups() {
for (const groupId of userDialogGroupEditSelectedGroupIds.value) { for (const groupId of userDialogGroupEditSelectedGroupIds.value) {
leaveGroupPrompt(groupId); leaveGroup(groupId);
} }
} }
@@ -3253,6 +3254,9 @@
function refreshUserDialogAvatars() { function refreshUserDialogAvatars() {
emit('refreshUserDialogAvatars'); emit('refreshUserDialogAvatars');
} }
function leaveGroup(id) {
emit('leaveGroup', id);
}
function leaveGroupPrompt(id) { function leaveGroupPrompt(id) {
emit('leaveGroupPrompt', id); emit('leaveGroupPrompt', id);
} }
+1
View File
@@ -112,6 +112,7 @@ mixin dialogs
@refreshUserDialogTreeData='refreshUserDialogTreeData' @refreshUserDialogTreeData='refreshUserDialogTreeData'
@saveUserMemo='saveUserMemo' @saveUserMemo='saveUserMemo'
@setGroupVisibility='setGroupVisibility' @setGroupVisibility='setGroupVisibility'
@leaveGroup='leaveGroup'
@leaveGroupPrompt='leaveGroupPrompt' @leaveGroupPrompt='leaveGroupPrompt'
@closeGalleryDialog='galleryDialogVisible = false') @closeGalleryDialog='galleryDialogVisible = false')