File tree 1 file changed +9
-3
lines changed
CS/ReportingApp/wwwroot/js
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 85
85
stylingMode : 'text' ,
86
86
onClick : ( ) => refreshAnswer ( data . component )
87
87
} ) ;
88
- buttonContainer . appendChild ( refreshBtnElement ) ;
88
+ if ( data . component . option ( 'items' ) . at ( - 1 ) . author === assistant . name ) {
89
+ buttonContainer . appendChild ( refreshBtnElement ) ;
90
+ lastRefreshButton = refreshBtnElement ;
91
+ }
89
92
container . appendChild ( buttonContainer ) ;
90
93
} ,
91
94
onMessageEntered : async ( e ) => {
95
+ lastRefreshButton ?. remove ( ) ;
92
96
const instance = e . component ;
93
97
instance . renderMessage ( e . message ) ;
94
98
instance . option ( { typingUsers : [ assistant ] } ) ;
95
99
const userInput = e . message . text ;
96
-
97
- var response = await getAIResponse ( userInput , assistant . id ) ;
100
+ if ( ! assistant . id && model . chatId ) {
101
+ assistant . id = model . chatId ;
102
+ }
103
+ const response = await getAIResponse ( instance , userInput , assistant . id ) ;
98
104
RenderAssistantMessage ( instance , response ) ;
99
105
}
100
106
} ;
You can’t perform that action at this time.
0 commit comments