Skip to content

Commit

Permalink
[Fix] 채팅방 썸네일 색 수정, 초대시 event 안가는 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mminjg committed Nov 25, 2021
1 parent 7d9d35c commit ee949ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backend/src/sockets/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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 }) => {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/components/Chat/ChatContent/Message/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ const Message: React.FC<Props> = ({ teamId, message }) => {
<Container myChat={isMyChat()}>
{!isMyChat() && (
<ChatIconWrapper>
<ProfileIcon name={teamUsers[message.userId].name} color={0} status='none' width={3.2} isHover={false} />
<ProfileIcon
name={teamUsers[message.userId].name}
color={teamUsers[message.userId].color}
status='none'
width={3.2}
isHover={false}
/>
</ChatIconWrapper>
)}
<MessageContainer myChat={isMyChat()}>
Expand Down

0 comments on commit ee949ff

Please sign in to comment.