From 2ded37b4c4aca84ff7a793ba93d81ddb8b68e235 Mon Sep 17 00:00:00 2001 From: Ankush Kumar Date: Wed, 5 Aug 2026 11:03:38 +0530 Subject: [PATCH] fix: prevent useEffect cleanup crash in Chat component --- src/frontend/src/pages/chat/Chat.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/chat/Chat.tsx b/src/frontend/src/pages/chat/Chat.tsx index 9750967..9a6cd32 100644 --- a/src/frontend/src/pages/chat/Chat.tsx +++ b/src/frontend/src/pages/chat/Chat.tsx @@ -146,8 +146,8 @@ const Chat = () => { setIsStreaming(false); }; - useEffect(() => chatMessageStreamEnd.current?.scrollIntoView({ behavior: "smooth" }), [isLoading]); - useEffect(() => chatMessageStreamEnd.current?.scrollIntoView({ behavior: "auto" }), [streamedAnswers]); + useEffect(() => { chatMessageStreamEnd.current?.scrollIntoView({ behavior: "smooth" }); }, [isLoading]); + useEffect(() => { chatMessageStreamEnd.current?.scrollIntoView({ behavior: "auto" }); }, [streamedAnswers]); const onPromptTemplateChange = (_ev?: React.FormEvent, newValue?: string) => { setPromptTemplate(newValue || "");