Skip to content

Commit

Permalink
Merge pull request #168 from boostcampwm-2021/hotfix/profile-socket
Browse files Browse the repository at this point in the history
[Fix] μ±„νŒ…λ°© 썸넀일 색 μˆ˜μ •, μ΄ˆλŒ€μ‹œ event μ•ˆκ°€λŠ” 였λ₯˜ μˆ˜μ •
  • Loading branch information
mminjg committed Nov 25, 2021
2 parents 025a145 + ee949ff commit 00efd61
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 00efd61

Please sign in to comment.