Skip to content

Commit 34b6f92

Browse files
authored
Feat/#365-C: 회의 시작에서 회의 참여로 변경 (#357)
* feat: 회의 시작에서 회의 참여로 변경 회의 시작 기능에 문제(#282)가 있어 참여로 변경 * fix: 회의 퇴장으로 변경
1 parent a134bcc commit 34b6f92

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

client/src/components/Sidebar/MeetingButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ function MeetingButton() {
1313
const { isOnGoing, setIsOnGoing } = MeetingContext;
1414

1515
const onClick = () => {
16+
if (isOnGoing) {
17+
socket.emit('bye');
18+
}
1619
setIsOnGoing(!isOnGoing);
17-
socket.emit(
18-
isOnGoing ? WORKSPACE_EVENT.END_MEETING : WORKSPACE_EVENT.START_MEETING,
19-
);
2020
};
2121

2222
return (
@@ -25,7 +25,7 @@ function MeetingButton() {
2525
onClick={onClick}
2626
style={{ backgroundColor: isOnGoing ? color.red : color.green }}
2727
>
28-
{isOnGoing ? '회의종료' : '회의시작'}
28+
{isOnGoing ? '회의퇴장' : '회의참여'}
2929
</button>
3030
);
3131
}

server/socket/workspace.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ function workspaceSocketServer(io: Server) {
5252
namespace.emit('video_state_changed', socket.id, videoOn);
5353
});
5454

55+
socket.on('bye', () => {
56+
const senderId = socket.id;
57+
socket.broadcast.emit(WORKSPACE_EVENT.RECEIVE_BYE, senderId);
58+
});
59+
5560
socket.on('disconnecting', () => {
5661
const senderId = socket.id;
5762
socket.broadcast.emit(WORKSPACE_EVENT.RECEIVE_BYE, senderId);

0 commit comments

Comments
 (0)