From 62de89520ae66932516e34c73f9f9b0b66ea8b69 Mon Sep 17 00:00:00 2001 From: Ethan Liu Date: Wed, 21 Jun 2023 12:24:50 +0800 Subject: [PATCH] fix: Do not send empty messages. --- components/prompt-form.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/prompt-form.tsx b/components/prompt-form.tsx index 75258c8..8d36838 100644 --- a/components/prompt-form.tsx +++ b/components/prompt-form.tsx @@ -15,7 +15,7 @@ import { IconArrowElbow, IconPlus } from '@/components/ui/icons' export interface PromptProps extends Pick { - onSubmit: (value: string) => void + onSubmit: (value: string) => Promise isLoading: boolean } @@ -38,7 +38,7 @@ export function PromptForm({
{ e.preventDefault() - if (input === '') { + if (!input?.trim()) { return } setInput('')