File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,6 +202,19 @@ const AcpDialogComponent: React.FC<AcpDialogProps> = ({
202202 } ,
203203 [ agentId , onUndoPrompt ] ,
204204 ) ;
205+ const inputValue = inputValues [ agentId ] ?? '' ;
206+ const handleInputChange = useCallback ( ( value : string ) => {
207+ setInputValues ( ( prev ) => {
208+ if ( ( prev [ agentId ] ?? '' ) === value ) {
209+ return prev ;
210+ }
211+
212+ return {
213+ ...prev ,
214+ [ agentId ] : value ,
215+ } ;
216+ } ) ;
217+ } , [ agentId ] ) ;
205218
206219 if ( ! isOpen ) return null ;
207220
@@ -222,21 +235,6 @@ const AcpDialogComponent: React.FC<AcpDialogProps> = ({
222235 ) ;
223236 }
224237
225- const inputValue = inputValues [ agentId ] ?? '' ;
226-
227- const handleInputChange = useCallback ( ( value : string ) => {
228- setInputValues ( ( prev ) => {
229- if ( ( prev [ agentId ] ?? '' ) === value ) {
230- return prev ;
231- }
232-
233- return {
234- ...prev ,
235- [ agentId ] : value ,
236- } ;
237- } ) ;
238- } , [ agentId ] ) ;
239-
240238 const handleSend = ( ) => {
241239 if ( inputValue . trim ( ) && isConnected ) {
242240 onSendPrompt ( agentId , inputValue . trim ( ) ) ;
You can’t perform that action at this time.
0 commit comments