Skip to content

Commit 676426b

Browse files
committed
fix: 안읽은 채팅 개수만 보여주기
1 parent 97cc5f2 commit 676426b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/common/utils/SocketProvider/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const SocketProvider = ({ children }: Props) => {
2020
console.log('앱 시작 시 WebSocket 연결 완료');
2121
unsubscribe = subChatListSocket(data => {
2222
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.CHAT_LIST] });
23-
setUnreadChatCount(data.message.unreadChatCount);
23+
if (data.type === 'UNREAD_CHAT_COUNT') setUnreadChatCount(data.message.unreadChatCount);
2424
});
2525
})
2626
.catch(err => {

src/features/chatList/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export interface ChatListInterface {
1515
}
1616

1717
export interface SubChatListInterface {
18-
type: 'CHAT';
18+
type: 'CHAT' | 'UNREAD_CHAT_COUNT';
1919
message: ChatListInterface;
2020
}

0 commit comments

Comments
 (0)