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

Fix space hierarchy tile busy state being stuck after join error #12405

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/components/structures/SpaceHierarchy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ const Tile: React.FC<ITileProps> = ({
setBusy(true);
ev.preventDefault();
ev.stopPropagation();
onJoinRoomClick()
.then(() => awaitRoomDownSync(cli, room.room_id))
.finally(() => {
setBusy(false);
});
try {
await onJoinRoomClick();
await awaitRoomDownSync(cli, room.room_id);
} finally {
setBusy(false);
}
};

let button: ReactElement;
Expand Down Expand Up @@ -418,7 +419,8 @@ export const joinRoom = async (cli: MatrixClient, hierarchy: RoomHierarchy, room
);
}

return;
// rethrow error so that the caller can handle react to it too
throw err;
}

defaultDispatcher.dispatch<JoinRoomReadyPayload>({
Expand Down
Loading