88import { ChatMessageList } from "@shared/components/ui/chat/chat-message-list" ;
99import { ChatInput } from "@shared/components/ui/chat/chat-input" ;
1010import { Button } from "@/shared/components/ui/button" ;
11-
1211import {
1312 ChatClientWithSession ,
1413 RagFlowMessage ,
@@ -35,7 +34,6 @@ export default function MessageBox({
3534 messageHistory || [ ]
3635 ) ;
3736 const [ isLoading , setIsLoading ] = useState ( false ) ;
38- const [ isMessageSent , setIsMessageSent ] = useState ( false ) ; // New state for tracking message sent
3937
4038 function cleanMessage ( content : string ) : string {
4139 return content . replace ( / # # \d + \$ \$ / g, "" ) . trim ( ) ;
@@ -48,7 +46,6 @@ export default function MessageBox({
4846 setMessages ( ( prev ) => [ ...prev , userMessage ] ) ;
4947 setValue ( "" ) ;
5048 setIsLoading ( true ) ;
51- setIsMessageSent ( true ) ;
5249 const response = await sendMessage ( chatClient , value ) ;
5350 setIsLoading ( false ) ;
5451
@@ -65,8 +62,6 @@ export default function MessageBox({
6562 content : response . response ,
6663 } ;
6764 setMessages ( ( prev ) => [ ...prev , assistantMessage ] ) ;
68-
69- setIsMessageSent ( false ) ;
7065 }
7166
7267 return (
@@ -75,7 +70,7 @@ export default function MessageBox({
7570 className = { "size-24 place-self-center stroke-black stroke-[10px]" }
7671 />
7772
78- < AutoScroll isMessageSent = { isMessageSent } >
73+ < AutoScroll messages = { messages } >
7974 < ChatMessageList smooth >
8075 { messages . map ( ( msg , index ) => (
8176 < ChatBubble
0 commit comments