Serialize and retry mass-leave when leaving space

This commit is contained in:
Michael Telatynski 2021-09-03 12:56:09 +01:00
parent 7d74cfecda
commit acb89d3447
2 changed files with 21 additions and 8 deletions

View file

@ -162,7 +162,9 @@ export const leaveSpace = (space: Room) => {
if (!leave) return;
const modal = Modal.createDialog(Spinner, null, "mx_Dialog_spinner");
try {
await Promise.all(rooms.map(r => leaveRoomBehaviour(r.roomId)));
for (const room of rooms) {
await leaveRoomBehaviour(room.roomId);
}
await leaveRoomBehaviour(space.roomId);
} finally {
modal.close();