add bio editing

This commit is contained in:
pypy
2020-03-21 14:54:55 +09:00
parent 59e74b78cb
commit cc3d89a954
2 changed files with 68 additions and 0 deletions

View File

@@ -6580,6 +6580,48 @@ CefSharp.BindObjectAsync(
D.visible = true;
};
// App: Bio Dialog
$app.data.bioDialog = {
visible: false,
loading: false,
bio: '',
bioLinks: []
};
API.$on('LOGOUT', function () {
$app.bioDialog.visible = false;
});
$app.methods.saveBio = function () {
var D = this.bioDialog;
if (D.loading) {
return;
}
D.loading = true;
API.saveCurrentUser({
bio: D.bio,
bioLinks: D.bioLinks
}).finally(() => {
D.loading = false;
}).then((args) => {
D.visible = false;
this.$message({
message: 'Bio updated',
type: 'success'
});
return args;
});
};
$app.methods.showBioDialog = function () {
this.$nextTick(() => adjustDialogZ(this.$refs.bioDialog.$el));
var D = this.bioDialog;
D.bio = API.currentUser.bio;
D.bioLinks = API.currentUser.bioLinks.slice();
D.visible = true;
};
// App: New Instance Dialog
$app.data.newInstanceDialog = {