diff --git a/src/components/Buyer/BuyerConsult/BuyerChatSection.tsx b/src/components/Buyer/BuyerConsult/BuyerChatSection.tsx index 3b6aa79d..3ccdf2ca 100644 --- a/src/components/Buyer/BuyerConsult/BuyerChatSection.tsx +++ b/src/components/Buyer/BuyerConsult/BuyerChatSection.tsx @@ -106,11 +106,11 @@ export const BuyerChatSection = ({ consultId: null, }; //add roomIds for unsubscribe - roomIdsRef.current.push(notification.chatId); + roomIdsRef.current.unshift(notification.chatId); cardDataRef.current = [ - ...cardDataRef.current, addedChatRoomItem, + ...cardDataRef.current, ]; setCardData(cardDataRef.current); diff --git a/src/components/Seller/SellerConsult/SellerChatList.tsx b/src/components/Seller/SellerConsult/SellerChatList.tsx index 6d2ebe4b..55550cc1 100644 --- a/src/components/Seller/SellerConsult/SellerChatList.tsx +++ b/src/components/Seller/SellerConsult/SellerChatList.tsx @@ -117,11 +117,11 @@ function SellerChatList({ consultId: null, }; //add roomIds for unsubscribe - roomIdsRef.current.push(notification.chatId); + roomIdsRef.current.unshift(notification.chatId); cardDataRef.current = [ - ...cardDataRef.current, addedChatRoomItem, + ...cardDataRef.current, ]; setConsultInfo(cardDataRef.current);