diff --git a/html/src/app.js b/html/src/app.js
index f5e77d2d..d4436e7d 100644
--- a/html/src/app.js
+++ b/html/src/app.js
@@ -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;
}
diff --git a/html/src/index.pug b/html/src/index.pug
index 2b2bd15e..fc2beed7 100644
--- a/html/src/index.pug
+++ b/html/src/index.pug
@@ -904,6 +904,9 @@ html
el-button(type="default" icon="el-icon-more" circle)
el-dropdown-menu(#default="dropdown")
el-dropdown-item(icon="el-icon-check" command="Select Avatar") Select Avatar
+ template(v-if="avatarDialog.ref.authorId === API.currentUser.id")
+ el-dropdown-item(v-if="avatarDialog.ref.releaseStatus === 'public'" icon="el-icon-user-solid" command="Make Private" divided) Make Private
+ el-dropdown-item(v-else icon="el-icon-user" command="Make Public" divided) Make Public
el-tabs
el-tab-pane(label="Info")
.x-friend-list