diff --git a/src/components/Menu/ChatHistoryList.tsx b/src/components/Menu/ChatHistoryList.tsx index 14513d9..0c4a4a2 100644 --- a/src/components/Menu/ChatHistoryList.tsx +++ b/src/components/Menu/ChatHistoryList.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import useStore from '@store/store'; +import { shallow } from 'zustand/shallow'; import ChatIcon from '@icon/ChatIcon'; import EditIcon from '@icon/EditIcon'; @@ -11,16 +12,19 @@ import useInitialiseNewChat from '@hooks/useInitialiseNewChat'; const ChatHistoryList = () => { const setCurrentChatIndex = useStore((state) => state.setCurrentChatIndex); - const chats = useStore((state) => state.chats); + const chatTitles = useStore( + (state) => state.chats?.map((chat) => chat.title), + shallow + ); return (