File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
frontend/src/components/chat Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -47,20 +47,20 @@ export const ChatInput = ({
4747 } ) ;
4848 } ;
4949
50- const handleSend = async ( e : React . FormEvent ) => {
51- console . log ( 'handleSend' , chatId , message ) ;
50+ const handleSend = async ( input ?: string ) => {
51+ console . log ( 'handleSend' , chatId , message , input ) ;
5252 setMessage ( '' ) ;
5353 if ( chat ?. status === 'wait_for_human_input' ) {
54- await handleHumanInput ( message ) ;
54+ await handleHumanInput ( input || message ) ;
5555 } else {
56- onSend ( message ) ;
56+ onSend ( input || message ) ;
5757 }
5858 } ;
5959
6060 const handleKeyDown = ( e : React . KeyboardEvent < HTMLTextAreaElement > ) => {
6161 console . log ( 'handleKeyDown' , chatId , e . key ) ;
6262 if ( e . key === 'Enter' && ! e . shiftKey ) {
63- handleSend ( e as any ) ;
63+ handleSend ( ) ;
6464 }
6565 } ;
6666
@@ -147,7 +147,7 @@ export const ChatInput = ({
147147 key = { index }
148148 variant = "outline"
149149 size = "sm"
150- onClick = { ( ) => setMessage ( message ) }
150+ onClick = { ( ) => handleSend ( message ) }
151151 className = "h-6 text-xs text-muted-foreground line-clamp-1 flex items-center justify-start"
152152 >
153153 { message }
You can’t perform that action at this time.
0 commit comments