Fix regressions around media uploads failing and causing soft crashes (#9549)
This commit is contained in:
parent
be5a8ca3b9
commit
77764d80bc
6 changed files with 17 additions and 218 deletions
|
@ -61,13 +61,14 @@ const SpaceSettingsGeneralTab = ({ matrixClient: cli, space, onFinished }: IProp
|
|||
|
||||
const onSave = async () => {
|
||||
setBusy(true);
|
||||
const promises = [];
|
||||
const promises: Promise<unknown>[] = [];
|
||||
|
||||
if (avatarChanged) {
|
||||
if (newAvatar) {
|
||||
promises.push(cli.sendStateEvent(space.roomId, EventType.RoomAvatar, {
|
||||
url: await cli.uploadContent(newAvatar),
|
||||
}, ""));
|
||||
promises.push((async () => {
|
||||
const { content_uri: url } = await cli.uploadContent(newAvatar);
|
||||
await cli.sendStateEvent(space.roomId, EventType.RoomAvatar, { url }, "");
|
||||
})());
|
||||
} else {
|
||||
promises.push(cli.sendStateEvent(space.roomId, EventType.RoomAvatar, {}, ""));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue