mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Fix shift click leave group
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1325,7 +1325,7 @@
|
||||
icon="el-icon-close"
|
||||
circle
|
||||
style="color: #f56c6c; margin-left: 5px"
|
||||
@click.stop="leaveGroupPrompt(group.id)">
|
||||
@click.stop="leaveGroup(group.id)">
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
@@ -2054,6 +2054,7 @@
|
||||
'refreshUserDialogTreeData',
|
||||
'saveUserMemo',
|
||||
'setGroupVisibility',
|
||||
'leaveGroup',
|
||||
'leaveGroupPrompt',
|
||||
'refreshGalleryTable',
|
||||
'refreshVRCPlusIconsTable',
|
||||
@@ -3170,7 +3171,7 @@
|
||||
// Leave (remove user from) all selected groups
|
||||
function bulkLeaveGroups() {
|
||||
for (const groupId of userDialogGroupEditSelectedGroupIds.value) {
|
||||
leaveGroupPrompt(groupId);
|
||||
leaveGroup(groupId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3253,6 +3254,9 @@
|
||||
function refreshUserDialogAvatars() {
|
||||
emit('refreshUserDialogAvatars');
|
||||
}
|
||||
function leaveGroup(id) {
|
||||
emit('leaveGroup', id);
|
||||
}
|
||||
function leaveGroupPrompt(id) {
|
||||
emit('leaveGroupPrompt', id);
|
||||
}
|
||||
|
||||
@@ -112,6 +112,7 @@ mixin dialogs
|
||||
@refreshUserDialogTreeData='refreshUserDialogTreeData'
|
||||
@saveUserMemo='saveUserMemo'
|
||||
@setGroupVisibility='setGroupVisibility'
|
||||
@leaveGroup='leaveGroup'
|
||||
@leaveGroupPrompt='leaveGroupPrompt'
|
||||
@closeGalleryDialog='galleryDialogVisible = false')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user