File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,8 +251,12 @@ export class WaveAIModel {
251251 async handleSubmit ( shouldFocus : boolean ) {
252252 const input = globalStore . get ( this . inputAtom ) ;
253253 const droppedFiles = globalStore . get ( this . droppedFiles ) ;
254-
255- if ( ( ! input . trim ( ) && droppedFiles . length === 0 ) || ( this . useChatStatus !== "ready" && this . useChatStatus !== "error" ) || globalStore . get ( this . isLoadingChatAtom ) ) {
254+
255+ if (
256+ ( ! input . trim ( ) && droppedFiles . length === 0 ) ||
257+ ( this . useChatStatus !== "ready" && this . useChatStatus !== "error" ) ||
258+ globalStore . get ( this . isLoadingChatAtom )
259+ ) {
256260 return ;
257261 }
258262
@@ -264,11 +268,11 @@ export class WaveAIModel {
264268
265269 this . clearError ( ) ;
266270
267- const aiMessageParts : AIMessagePart [ ] = [ { type : "text" , text : input . trim ( ) } ] ;
268-
271+ const aiMessageParts : AIMessagePart [ ] = [ ] ;
269272 const uiMessageParts : WaveUIMessagePart [ ] = [ ] ;
270273
271274 if ( input . trim ( ) ) {
275+ aiMessageParts . push ( { type : "text" , text : input . trim ( ) } ) ;
272276 uiMessageParts . push ( { type : "text" , text : input . trim ( ) } ) ;
273277 }
274278
You can’t perform that action at this time.
0 commit comments