Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3803 from matrix-org/t3chguy/fix_avatar_remove
Browse files Browse the repository at this point in the history
Fix ability to remove avatars
  • Loading branch information
t3chguy authored Jan 6, 2020
2 parents 6b6d0dd + d5eb4ff commit 4c40266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/views/room_settings/RoomProfileSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export default class RoomProfileSettings extends React.Component {
newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false);
newState.originalAvatarUrl = newState.avatarUrl;
newState.avatarFile = null;
} else if (this.state.originalAvatarUrl !== this.state.avatarUrl) {
await client.sendStateEvent(this.props.roomId, 'm.room.avatar', {url: undefined}, '');
}

if (this.state.originalTopic !== this.state.topic) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/settings/ProfileSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export default class ProfileSettings extends React.Component {
newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false);
newState.originalAvatarUrl = newState.avatarUrl;
newState.avatarFile = null;
} else if (this.state.originalAvatarUrl !== this.state.avatarUrl) {
await client.setAvatarUrl(""); // use empty string as Synapse 500s on undefined
}

this.setState(newState);
Expand Down

0 comments on commit 4c40266

Please sign in to comment.