Przeglądaj źródła

Fix: Prevent submission of empty prompts with spaces (#5874)

Co-authored-by: openhands <openhands@all-hands.dev>
mamoodi 1 rok temu
rodzic
commit
157ff4a4b9
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      frontend/src/components/shared/task-form.tsx

+ 3 - 1
frontend/src/components/shared/task-form.tsx

@@ -90,7 +90,9 @@ export function TaskForm({ ref }: TaskFormProps) {
     const formData = new FormData(event.currentTarget);
 
     const q = formData.get("q")?.toString();
-    newConversationMutation.mutate({ q });
+    if (q?.trim()) {
+      newConversationMutation.mutate({ q });
+    }
   };
 
   return (