fix: Do not send empty messages. (#66)
This commit is contained in:
commit
255ce6394e
1 changed files with 2 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ import { IconArrowElbow, IconPlus } from '@/components/ui/icons'
|
||||||
|
|
||||||
export interface PromptProps
|
export interface PromptProps
|
||||||
extends Pick<UseChatHelpers, 'input' | 'setInput'> {
|
extends Pick<UseChatHelpers, 'input' | 'setInput'> {
|
||||||
onSubmit: (value: string) => void
|
onSubmit: (value: string) => Promise<void>
|
||||||
isLoading: boolean
|
isLoading: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ export function PromptForm({
|
||||||
<form
|
<form
|
||||||
onSubmit={async e => {
|
onSubmit={async e => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if (input === '') {
|
if (!input?.trim()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setInput('')
|
setInput('')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue