diff --git a/memento-note/app/actions/chat-actions.ts b/memento-note/app/actions/chat-actions.ts index b06b05a..d26eb9a 100644 --- a/memento-note/app/actions/chat-actions.ts +++ b/memento-note/app/actions/chat-actions.ts @@ -21,7 +21,6 @@ export async function createConversation(title: string, notebookId?: string) { }, }) - revalidatePath('/chat') return { id: conversation.id, title: conversation.title } } @@ -69,6 +68,5 @@ export async function deleteConversation(id: string) { where: { id, userId: session.user.id } }) - revalidatePath('/chat') return { success: true } } diff --git a/memento-note/components/chat/chat-container.tsx b/memento-note/components/chat/chat-container.tsx index ea29610..9cc98c6 100644 --- a/memento-note/components/chat/chat-container.tsx +++ b/memento-note/components/chat/chat-container.tsx @@ -60,12 +60,14 @@ export function ChatContainer({ initialConversations, notebooks, webSearchAvaila }, [isLoading, t]) // Sync historyMessages after each completed streaming response - // so the display doesn't revert to stale history + // so the display doesn't revert to stale history. + // Also refresh sidebar so new conversation appears. useEffect(() => { if (status === 'ready' && messages.length > 0) { setHistoryMessages([...messages]) + refreshConversations() } - }, [status, messages]) + }, [status, messages, refreshConversations]) // Load conversation details when the user selects a different conversation useEffect(() => {