mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Delete avatar
This commit is contained in:
@@ -1734,6 +1734,21 @@ speechSynthesis.getVoices();
|
|||||||
this.$emit('USER:CURRENT', args);
|
this.$emit('USER:CURRENT', args);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
API.$on('AVATAR:DELETE', function (args) {
|
||||||
|
var { json } = args;
|
||||||
|
this.cachedAvatars.delete(json._id);
|
||||||
|
if ($app.userDialog.id === json.authorId) {
|
||||||
|
var map = new Map();
|
||||||
|
for (var ref of this.cachedAvatars.values()) {
|
||||||
|
if (ref.authorId === json.authorId) {
|
||||||
|
map.set(ref.id, ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var array = Array.from(map.values());
|
||||||
|
$app.setUserDialogAvatars(array);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
API.applyAvatar = function (json) {
|
API.applyAvatar = function (json) {
|
||||||
var ref = this.cachedAvatars.get(json.id);
|
var ref = this.cachedAvatars.get(json.id);
|
||||||
if (typeof ref === 'undefined') {
|
if (typeof ref === 'undefined') {
|
||||||
@@ -1869,6 +1884,11 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
params: {
|
||||||
|
avatarId: string
|
||||||
|
}
|
||||||
|
*/
|
||||||
API.selectFallbackAvatar = function (params) {
|
API.selectFallbackAvatar = function (params) {
|
||||||
return this.call(`avatars/${params.avatarId}/selectfallback`, {
|
return this.call(`avatars/${params.avatarId}/selectfallback`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
@@ -1883,6 +1903,25 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
params: {
|
||||||
|
avatarId: string
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
API.deleteAvatar = function (params) {
|
||||||
|
return this.call(`avatars/${params.avatarId}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
this.$emit('AVATAR:DELETE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// API: Notification
|
// API: Notification
|
||||||
|
|
||||||
API.cachedNotifications = new Map();
|
API.cachedNotifications = new Map();
|
||||||
@@ -8309,6 +8348,18 @@ speechSynthesis.getVoices();
|
|||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'Delete':
|
||||||
|
API.deleteAvatar({
|
||||||
|
avatarId: D.id
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Avatar deleted',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
D.visible = false;
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1165,6 +1165,7 @@ html
|
|||||||
el-dropdown-item(v-else icon="el-icon-user" command="Make Public" divided) Make Public
|
el-dropdown-item(v-else icon="el-icon-user" command="Make Public" divided) Make Public
|
||||||
el-dropdown-item(icon="el-icon-edit" command="Rename") Rename
|
el-dropdown-item(icon="el-icon-edit" command="Rename") Rename
|
||||||
el-dropdown-item(icon="el-icon-edit" command="Change Description") Change Description
|
el-dropdown-item(icon="el-icon-edit" command="Change Description") Change Description
|
||||||
|
el-dropdown-item(icon="el-icon-user" command="Delete" style="color:#F56C6C" divided) Delete
|
||||||
el-tabs
|
el-tabs
|
||||||
el-tab-pane(label="Info")
|
el-tab-pane(label="Info")
|
||||||
.x-friend-list
|
.x-friend-list
|
||||||
|
|||||||
Reference in New Issue
Block a user