Skip to content

Commit 8de7e5d

Browse files
committed
fix submit gate. can submit with empty input if we have dropped files. also allow submitting when we have an error status
1 parent 6bfbb15 commit 8de7e5d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

frontend/app/aipanel/waveai-model.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ export class WaveAIModel {
250250

251251
async handleSubmit(shouldFocus: boolean) {
252252
const input = globalStore.get(this.inputAtom);
253-
if (!input.trim() || this.useChatStatus !== "ready" || globalStore.get(this.isLoadingChatAtom)) {
253+
const droppedFiles = globalStore.get(this.droppedFiles);
254+
255+
if ((!input.trim() && droppedFiles.length === 0) || (this.useChatStatus !== "ready" && this.useChatStatus !== "error") || globalStore.get(this.isLoadingChatAtom)) {
254256
return;
255257
}
256258

@@ -262,8 +264,6 @@ export class WaveAIModel {
262264

263265
this.clearError();
264266

265-
const droppedFiles = globalStore.get(this.droppedFiles);
266-
267267
const aiMessageParts: AIMessagePart[] = [{ type: "text", text: input.trim() }];
268268

269269
const uiMessageParts: WaveUIMessagePart[] = [];

0 commit comments

Comments
 (0)