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

Commit

Permalink
Fix space hierarchy tile busy state being stuck after join error (#12405
Browse files Browse the repository at this point in the history
)

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Apr 8, 2024
1 parent 5815e70 commit 1149b13
Showing 1 changed file with 8 additions and 6 deletions.
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

0 comments on commit 1149b13

Please sign in to comment.