From ee949ff7f049b821dc268f026dda632a45eaad3d Mon Sep 17 00:00:00 2001 From: Kang Minji Date: Thu, 25 Nov 2021 19:39:22 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EC=B1=84=ED=8C=85=EB=B0=A9=20=EC=8D=B8?= =?UTF-8?q?=EB=84=A4=EC=9D=BC=20=EC=83=89=20=EC=88=98=EC=A0=95,=20?= =?UTF-8?q?=EC=B4=88=EB=8C=80=EC=8B=9C=20event=20=EC=95=88=EA=B0=80?= =?UTF-8?q?=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/sockets/chat.ts | 2 ++ .../src/components/Chat/ChatContent/Message/index.tsx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/src/sockets/chat.ts b/backend/src/sockets/chat.ts index a66fdeb..75913ef 100644 --- a/backend/src/sockets/chat.ts +++ b/backend/src/sockets/chat.ts @@ -57,6 +57,7 @@ const initChat = (socket: Socket, namespace: Namespace) => { }); }); + // 초대받은 사람들 chat room users refresh socket.on('invite users', ({ chatRoomId, userList, teamId }) => { userList.forEach((user: { userId: number }) => { const onlineInvitedUser = Object.keys(onlineUsersInfo).find((socketId) => { @@ -67,6 +68,7 @@ const initChat = (socket: Socket, namespace: Namespace) => { socket.to(onlineInvitedUser).emit('refresh chat rooms'); } }); + namespace.to(`chat-${chatRoomId}`).emit('refresh chat room users', { chatRoomId }); }); socket.on('exit chat room', ({ chatRoomId }) => { diff --git a/frontend/src/components/Chat/ChatContent/Message/index.tsx b/frontend/src/components/Chat/ChatContent/Message/index.tsx index 68c5e42..5d38aa1 100644 --- a/frontend/src/components/Chat/ChatContent/Message/index.tsx +++ b/frontend/src/components/Chat/ChatContent/Message/index.tsx @@ -24,7 +24,13 @@ const Message: React.FC = ({ teamId, message }) => { {!isMyChat() && ( - + )}