From 9753b5a6c5b0ff5b686b6232bdba195100b5ee8c Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Tue, 2 Dec 2025 18:44:44 -0300 Subject: [PATCH] update chat history after message is received --- frontend/hooks/useChatStreaming.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/hooks/useChatStreaming.ts b/frontend/hooks/useChatStreaming.ts index 6836ed4b..c67a0ca6 100644 --- a/frontend/hooks/useChatStreaming.ts +++ b/frontend/hooks/useChatStreaming.ts @@ -4,6 +4,7 @@ import type { Message, SelectedFilters, } from "@/app/chat/_types/types"; +import { useChat } from "@/contexts/chat-context"; interface UseChatStreamingOptions { endpoint?: string; @@ -32,6 +33,8 @@ export function useChatStreaming({ const streamAbortRef = useRef(null); const streamIdRef = useRef(0); + const { refreshConversations } = useChat(); + const sendMessage = async ({ prompt, previousResponseId, @@ -498,6 +501,7 @@ export function useChatStreaming({ // Clear streaming message and call onComplete with final message setStreamingMessage(null); onComplete?.(finalMessage, newResponseId); + refreshConversations(true); return finalMessage; }