From 48e511c034ff7797a8c5b39f7a797f8d213d6501 Mon Sep 17 00:00:00 2001 From: Mav-Ivan <110425368+Mav-Ivan@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:01:25 +0200 Subject: [PATCH] fixed according to comments --- src/containers/chat/chat-header/ChatHeader.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/containers/chat/chat-header/ChatHeader.tsx b/src/containers/chat/chat-header/ChatHeader.tsx index eb2356a30a..9c9445521e 100644 --- a/src/containers/chat/chat-header/ChatHeader.tsx +++ b/src/containers/chat/chat-header/ChatHeader.tsx @@ -106,10 +106,13 @@ const ChatHeader: FC = ({ [currentChat._id] ) - const onAllMessagesResponse = useCallback((response: GetMessagesResponse) => { - const items = response.items ?? [] - setAllMessages(items) - }, []) + const onAllMessagesResponse = useCallback( + (response: GetMessagesResponse) => { + const items = response.items ?? [] + setAllMessages(items) + }, + [setAllMessages] + ) const { fetchData } = useAxios({ service: getAllMessages,