Fix ability to remove avatars
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
65954b1e1b
commit
295dcbfe48
2 changed files with 4 additions and 0 deletions
|
@ -98,6 +98,8 @@ export default class RoomProfileSettings extends React.Component {
|
||||||
newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false);
|
newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false);
|
||||||
newState.originalAvatarUrl = newState.avatarUrl;
|
newState.originalAvatarUrl = newState.avatarUrl;
|
||||||
newState.avatarFile = null;
|
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) {
|
if (this.state.originalTopic !== this.state.topic) {
|
||||||
|
|
|
@ -88,6 +88,8 @@ export default class ProfileSettings extends React.Component {
|
||||||
newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false);
|
newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false);
|
||||||
newState.originalAvatarUrl = newState.avatarUrl;
|
newState.originalAvatarUrl = newState.avatarUrl;
|
||||||
newState.avatarFile = null;
|
newState.avatarFile = null;
|
||||||
|
} else if (this.state.originalAvatarUrl !== this.state.avatarUrl) {
|
||||||
|
await client.setAvatarUrl(""); // use empty string as Synapse 500's on undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue