From 5c8c4346a9b44ecaa18b939fd78348f06c82763d Mon Sep 17 00:00:00 2001 From: balibabu Date: Fri, 7 Aug 2026 11:28:50 +0800 Subject: [PATCH] Fix: Start a new conversation; an additional conversation entry will appear once the chat ends. (#17964) --- .../hooks/use-select-conversation-list.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/web/src/pages/next-chats/hooks/use-select-conversation-list.ts b/web/src/pages/next-chats/hooks/use-select-conversation-list.ts index e1fa8f2b1f..624deeacc2 100644 --- a/web/src/pages/next-chats/hooks/use-select-conversation-list.ts +++ b/web/src/pages/next-chats/hooks/use-select-conversation-list.ts @@ -84,15 +84,19 @@ export const useSelectDerivedConversationList = () => { // When you first enter the page, select the top conversation card + // useEffect(() => { + // setList((prevList) => { + // const tempItems = prevList.filter((item) => item.is_new); + // const existingTempIds = new Set(tempItems.map((t) => t.id)); + // const newItems = conversationList.filter( + // (item) => !existingTempIds.has(item.id), + // ); + // return [...tempItems, ...newItems]; + // }); + // }, [conversationList]); + useEffect(() => { - setList((prevList) => { - const tempItems = prevList.filter((item) => item.is_new); - const existingTempIds = new Set(tempItems.map((t) => t.id)); - const newItems = conversationList.filter( - (item) => !existingTempIds.has(item.id), - ); - return [...tempItems, ...newItems]; - }); + setList([...conversationList]); }, [conversationList]); return {