Merge pull request #6126 from matrix-org/t3chguy/fix/rs5384

Fix the ability to remove avatar from a space via settings
This commit is contained in:
Michael Telatynski 2021-06-01 12:11:10 +01:00 committed by GitHub
commit c6c1e09cae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,9 +73,13 @@ const SpaceSettingsDialog: React.FC<IProps> = ({ matrixClient: cli, space, onFin
const promises = [];
if (avatarChanged) {
promises.push(cli.sendStateEvent(space.roomId, EventType.RoomAvatar, {
url: await cli.uploadContent(newAvatar),
}, ""));
if (newAvatar) {
promises.push(cli.sendStateEvent(space.roomId, EventType.RoomAvatar, {
url: await cli.uploadContent(newAvatar),
}, ""));
} else {
promises.push(cli.sendStateEvent(space.roomId, EventType.RoomAvatar, {}, ""));
}
}
if (nameChanged) {