File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
app/project/[id]/_components/right-panel/chat-tab/chat-input
components/store/editor/chat Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -138,21 +138,21 @@ export const ChatInput = observer(({
138138 }
139139
140140 const savedInput = inputValue . trim ( ) ;
141- setInputValue ( '' ) ;
142141
143142 try {
144143 if ( isStreaming ) {
145- // Queue the message if currently streaming
144+ // Queue the message if streaming
146145 const queuedMessage = editorEngine . chat . queue . enqueue ( savedInput , chatMode ) ;
147146 console . log ( 'Message queued:' , queuedMessage ) ;
148147 } else {
149148 // Send immediately if not streaming
150149 await onSendMessage ( savedInput , chatMode ) ;
151150 }
151+ // Clear input
152+ setInputValue ( '' ) ;
152153 } catch ( error ) {
153154 console . error ( 'Error sending message' , error ) ;
154155 toast . error ( 'Failed to send message. Please try again.' ) ;
155- setInputValue ( savedInput ) ;
156156 }
157157 }
158158
Original file line number Diff line number Diff line change @@ -68,12 +68,13 @@ export class MessageQueue {
6868 return ;
6969 }
7070
71+ this . _isProcessing = true ;
72+
7173 const nextMessage = this . dequeue ( ) ;
7274 if ( ! nextMessage ) {
75+ this . _isProcessing = false ;
7376 return ;
7477 }
75-
76- this . _isProcessing = true ;
7778
7879 try {
7980 await this . editorEngine . chat . sendMessage ( nextMessage . content , nextMessage . type ) ;
You can’t perform that action at this time.
0 commit comments