Skip to content

Commit

Permalink
fix: loop join room bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnsonMao committed Nov 2, 2024
1 parent d0a3f8b commit 6d3db27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions containers/room/RoomListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const RoomsListView: FC<Props> = ({ status }) => {
async function fetchRoomEntry(_roomId: string) {
setIsLoading(true);

// Automatically enter the room if room information is accessible,
// indicating the user is already in the room
if (await fetch(getRoomInfoEndpoint(_roomId)).catch(() => {})) {
router.push(`/rooms/${_roomId}`);
updateRoomId(_roomId);
Expand All @@ -80,6 +82,7 @@ const RoomsListView: FC<Props> = ({ status }) => {
} finally {
setPasswordValues(INIT_PASSWORD);
setIsLoading(false);
setRoomId(null);
}
}

Expand Down

0 comments on commit 6d3db27

Please sign in to comment.