mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
setting release status on own avatars (closes #46)
This commit is contained in:
@@ -1640,6 +1640,16 @@ CefSharp.BindObjectAsync(
|
||||
}
|
||||
});
|
||||
|
||||
API.$on('AVATAR:SAVE', function (args) {
|
||||
var { json } = args;
|
||||
this.$emit('AVATAR', {
|
||||
json,
|
||||
params: {
|
||||
avatarId: json.id
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
API.$on('AVATAR:SELECT', function (args) {
|
||||
this.$emit('USER:CURRENT', args);
|
||||
});
|
||||
@@ -1740,6 +1750,26 @@ CefSharp.BindObjectAsync(
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
params: {
|
||||
id: string
|
||||
releaseStatus: string ('public','private'),
|
||||
}
|
||||
*/
|
||||
API.saveAvatar = function (params) {
|
||||
return this.call(`avatars/${params.id}`, {
|
||||
method: 'PUT',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('AVATAR:SAVE', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
params: {
|
||||
avatarId: string
|
||||
@@ -6567,6 +6597,30 @@ CefSharp.BindObjectAsync(
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
case 'Make Public':
|
||||
API.saveAvatar({
|
||||
id: D.id,
|
||||
releaseStatus: 'public'
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: 'Avatar updated to public',
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});;
|
||||
break;
|
||||
case 'Make Private':
|
||||
API.saveAvatar({
|
||||
id: D.id,
|
||||
releaseStatus: 'private'
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: 'Avatar updated to private',
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user