Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Overnap
2021-06-06 02:05:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
039823cdb5e2373eccd03d089917b45265ded3dd
039823cd
1 parent
7835516f
방 나갈 때 leaveRoom 전송 추가
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
web/src/components/room/RoomInfo.tsx
web/src/components/room/RoomInfo.tsx
View file @
039823c
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { useLocation, useParams } from 'react-router';
import SocketContext from '../../contexts/SocketContext';
import { Message
Typ
e } from '../common/types';
import { Message
Response, MessageType, RawMessag
e } from '../common/types';
import { RoomData, UpdateRoomUser } from './types';
interface RoomInfoLocation {
...
...
@@ -47,6 +47,12 @@ export const RoomInfo: React.FC = () => {
return () => {
socket.off(MessageType.ROOM_USER_UPDATE, handleUpdateRoomUser);
const rawMessage: RawMessage = {
type: MessageType.ROOM_LEAVE,
message: ''
}
socket.emit('msg', rawMessage, (response : MessageResponse<undefined>) => {});
}
}, []);
...
...
Please
register
or
login
to post a comment