File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments