From 157ff4a4b905e12f973a3ac4d2053a65212fe031 Mon Sep 17 00:00:00 2001 From: mamoodi Date: Fri, 27 Dec 2024 15:31:28 -0500 Subject: [PATCH] Fix: Prevent submission of empty prompts with spaces (#5874) Co-authored-by: openhands --- frontend/src/components/shared/task-form.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/shared/task-form.tsx b/frontend/src/components/shared/task-form.tsx index 3f71dadca9c5..bc6b53c24748 100644 --- a/frontend/src/components/shared/task-form.tsx +++ b/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 (