mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 18:35:58 +08:00
fix: not show opening question if the opening message is empty (#5856)
This commit is contained in:
parent
a948bf6ee8
commit
6d0a605c5f
@ -20,6 +20,7 @@ import { getInputKeys } from '@/app/components/base/block-input'
|
|||||||
import ConfirmAddVar from '@/app/components/app/configuration/config-prompt/confirm-add-var'
|
import ConfirmAddVar from '@/app/components/app/configuration/config-prompt/confirm-add-var'
|
||||||
import { getNewVar } from '@/utils/var'
|
import { getNewVar } from '@/utils/var'
|
||||||
import { varHighlightHTML } from '@/app/components/app/configuration/base/var-highlight'
|
import { varHighlightHTML } from '@/app/components/app/configuration/base/var-highlight'
|
||||||
|
import Toast from '@/app/components/base/toast'
|
||||||
|
|
||||||
const MAX_QUESTION_NUM = 5
|
const MAX_QUESTION_NUM = 5
|
||||||
|
|
||||||
@ -93,6 +94,15 @@ const OpeningStatement: FC<IOpeningStatementProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
|
if (!(tempValue || '').trim()) {
|
||||||
|
Toast.notify({
|
||||||
|
type: 'error',
|
||||||
|
message: t('common.errorMsg.fieldRequired', {
|
||||||
|
field: t('appDebug.openingStatement.title'),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
const keys = getInputKeys(tempValue)
|
const keys = getInputKeys(tempValue)
|
||||||
const promptKeys = promptVariables.map(item => item.key)
|
const promptKeys = promptVariables.map(item => item.key)
|
||||||
let notIncludeKeys: string[] = []
|
let notIncludeKeys: string[] = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user