@@ -391,6 +391,10 @@ const AIAnswer = defineComponent({
391391 return null ;
392392 } ,
393393 handleTriggerClick ( ) {
394+ window . console . log (
395+ 'this.$props.triggerOn === AI_TRIGGER_MODES.MANUAL' ,
396+ this . $props . triggerOn === AI_TRIGGER_MODES . MANUAL ,
397+ ) ;
394398 if ( this . $props . triggerOn === AI_TRIGGER_MODES . MANUAL ) {
395399 this . handleSendMessage ( null , false , '' , true ) ;
396400 this . isTriggered = true ;
@@ -492,13 +496,19 @@ const AIAnswer = defineComponent({
492496 } ,
493497 handleSendMessage ( e , isRetry = false , text = this . inputMessage , fetchMeta = false ) {
494498 if ( typeof e === 'object' && e !== null ) e . preventDefault ( ) ;
495- if ( text . trim ( ) ) {
499+ if ( text . trim ( ) || ( ! text && ! e ) ) {
496500 if ( this . isLoadingState ) {
497501 return ;
498502 }
499503 if ( this . AISessionId ) {
500- if ( ! isRetry )
501- this . messages = [ ...this . messages , { content : text , role : AI_ROLES . USER } ] ;
504+ if ( ! isRetry ) {
505+ const finalMessages = [ ...this . messages ] ;
506+ if ( text ) {
507+ finalMessages . push ( { content : text , role : AI_ROLES . USER } ) ;
508+ }
509+
510+ this . messages = [ ...finalMessages ] ;
511+ }
502512 this . getAIResponse ( this . AISessionId , this . componentId , text , fetchMeta ) ;
503513 } else {
504514 console . error ( this . errorMessageForMissingSessionId ) ;
@@ -810,7 +820,7 @@ const AIAnswer = defineComponent({
810820 </ MessagesContainer >
811821 ) }
812822 { this . renderErrorComponent ( ) } { ' ' }
813- { props . showFeedback && (
823+ { props . showFeedback && ! this . isLoadingState && ! this . isAITyping && (
814824 < div
815825 class = { `--ai-answer-feedback-container ${
816826 getClassName ( props . innerClass , 'ai-feedback' ) || ''
0 commit comments