diff --git a/server/src/api/user.rs b/server/src/api/user.rs index 9b72a9199..1284c6608 100644 --- a/server/src/api/user.rs +++ b/server/src/api/user.rs @@ -451,6 +451,11 @@ impl Perform for Oper { None => read_user.email, }; + let avatar = match &data.avatar { + Some(avatar) => Some(avatar.to_owned()), + None => read_user.avatar, + }; + let password_encrypted = match &data.new_password { Some(new_password) => { match &data.new_password_verify { @@ -488,7 +493,7 @@ impl Perform for Oper { name: read_user.name, email, matrix_user_id: data.matrix_user_id.to_owned(), - avatar: data.avatar.to_owned(), + avatar, password_encrypted, preferred_username: read_user.preferred_username, updated: Some(naive_now()), diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx index af72a3974..0e1073635 100644 --- a/ui/src/components/user.tsx +++ b/ui/src/components/user.tsx @@ -535,7 +535,7 @@ export class User extends Component { htmlFor="file-upload" class="pointer ml-4 text-muted small font-weight-bold" > - {!this.state.userSettingsForm.avatar ? ( + {!this.checkSettingsAvatar ? ( {i18n.t('upload_avatar')} @@ -559,6 +559,18 @@ export class User extends Component { /> + {this.checkSettingsAvatar && ( +
+ +
+ )}