Skip to content

Commit

Permalink
fix(flat-pages): refresh rooms list on any join room error (#2118)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Feb 21, 2024
1 parent 5738311 commit e8bf66c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/flat-pages/src/utils/join-room-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const joinRoomHandler = async (
);
}
} catch (e) {
globalStore.updateRequestRefreshRooms(true);

// if room not found and is pmi room, show wait for teacher to enter
if (e.errorCode === RequestErrorCode.RoomNotFoundAndIsPmi) {
void message.info(FlatI18n.t("wait-for-teacher-to-enter"));
Expand All @@ -67,14 +69,9 @@ export const joinRoomHandler = async (
};
pushHistory(RouteNameType.HomePage);
globalStore.updateRoomNotBegin(roomNotBegin);
globalStore.updateRequestRefreshRooms(true);
return;
}

if (e.errorCode === RequestErrorCode.RoomNotBegin) {
globalStore.updateRequestRefreshRooms(true);
}

pushHistory(RouteNameType.HomePage);
errorTips(e);
}
Expand Down

0 comments on commit e8bf66c

Please sign in to comment.