Skip to content

FIX: 새로 방을 개설했을 때만, 강의 시작시간과 화이트보드 초기 데이터 반영 #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions mediaServer/src/RelayServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ export class RelayServer {
this.clientsConnectionInfo.set(email, new ClientConnectionInfo(RTCPC));
this.roomsConnectionInfo.set(data.roomId, new RoomConnectionInfo(RTCPC));
socket.join(email);
await Promise.all([
saveClientInfo(email, ClientType.PRESENTER, data.roomId),
saveRoomInfo(data.roomId, new RoomInfoDto(email, data.whiteboard))
]);
if (roomInfo.presenterEmail !== email) {
if (await isQuestionStreamExisted(data.roomId)) {
await deleteQuestionStream(data.roomId);
}
await setQuestionStreamAndGroup(data.roomId);
await Promise.all([
saveClientInfo(email, ClientType.PRESENTER, data.roomId),
saveRoomInfo(data.roomId, new RoomInfoDto(email, data.whiteboard))
]);
}
if (roomInfo.presenterEmail === email) {
await sendDataToReconnectPresenter(email, data.roomId, roomInfo);
Expand Down
2 changes: 1 addition & 1 deletion mediaServer/src/services/client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const saveClientInfo = async (email: string, clientType: ClientType, roomId: str
const sendDataToReconnectPresenter = async (email: string, roomId: string, roomInfo: Record<string, string>) => {
const unsolvedQuestions = (await findUnsolvedQuestions(roomId, email)) as StreamReadRaw;
sendMessageUsingSocket('/create-room', email, 'reconnectPresenter', {
whiteboard: roomInfo.currentWhiteboardData,
whiteboard: JSON.parse(roomInfo.currentWhiteboardData),
startTime: roomInfo.startTime,
questions: unsolvedQuestions[0][1]
});
Expand Down