mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 21:55:53 +08:00
chore: enchange pic uploading tip (#2388)
Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
parent
5010706d8b
commit
805ed84f61
@ -62,6 +62,14 @@ const ChatInput: FC<ChatInputProps> = ({
|
|||||||
|
|
||||||
const handleSend = () => {
|
const handleSend = () => {
|
||||||
if (onSend) {
|
if (onSend) {
|
||||||
|
if (files.find(item => item.type === TransferMethod.local_file && !item.fileId)) {
|
||||||
|
notify({ type: 'info', message: t('appDebug.errorMessage.waitForImgUpload') })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!query || !query.trim()) {
|
||||||
|
notify({ type: 'info', message: t('appAnnotation.errorMessage.queryRequired') })
|
||||||
|
return
|
||||||
|
}
|
||||||
onSend(query, files.filter(file => file.progress !== -1).map(fileItem => ({
|
onSend(query, files.filter(file => file.progress !== -1).map(fileItem => ({
|
||||||
type: 'image',
|
type: 'image',
|
||||||
transfer_method: fileItem.type,
|
transfer_method: fileItem.type,
|
||||||
@ -69,10 +77,7 @@ const ChatInput: FC<ChatInputProps> = ({
|
|||||||
upload_file_id: fileItem.fileId,
|
upload_file_id: fileItem.fileId,
|
||||||
})))
|
})))
|
||||||
setQuery('')
|
setQuery('')
|
||||||
}
|
onClear()
|
||||||
if (!files.find(item => item.type === TransferMethod.local_file && !item.fileId)) {
|
|
||||||
if (files.length)
|
|
||||||
onClear()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,8 +189,7 @@ export const useChat = (
|
|||||||
}: SendCallback,
|
}: SendCallback,
|
||||||
) => {
|
) => {
|
||||||
setSuggestQuestions([])
|
setSuggestQuestions([])
|
||||||
if (!data.query || !data.query.trim())
|
|
||||||
return
|
|
||||||
if (isResponsingRef.current) {
|
if (isResponsingRef.current) {
|
||||||
notify({ type: 'info', message: t('appDebug.errorMessage.waitForResponse') })
|
notify({ type: 'info', message: t('appDebug.errorMessage.waitForResponse') })
|
||||||
return false
|
return false
|
||||||
|
@ -96,8 +96,13 @@ const Result: FC<IResultProps> = ({
|
|||||||
return true
|
return true
|
||||||
|
|
||||||
const prompt_variables = promptConfig?.prompt_variables
|
const prompt_variables = promptConfig?.prompt_variables
|
||||||
if (!prompt_variables || prompt_variables?.length === 0)
|
if (!prompt_variables || prompt_variables?.length === 0) {
|
||||||
|
if (completionFiles.find(item => item.transfer_method === TransferMethod.local_file && !item.upload_file_id)) {
|
||||||
|
notify({ type: 'info', message: t('appDebug.errorMessage.waitForImgUpload') })
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
let hasEmptyInput = ''
|
let hasEmptyInput = ''
|
||||||
const requiredVars = prompt_variables?.filter(({ key, name, required }) => {
|
const requiredVars = prompt_variables?.filter(({ key, name, required }) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user