mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-09 00:47:59 +08:00
Fix: Start a new conversation; an additional conversation entry will appear once the chat ends. (#17964)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user