mirror of https://github.com/langgenius/dify.git
fix: improve handleVariableNameBlur logic to prevent setting label when it already exists
This commit is contained in:
parent
e0753ebfd1
commit
5c0d19e36d
|
|
@ -92,10 +92,11 @@ export const useConfigurations = (props: {
|
|||
}, [setFieldValue])
|
||||
|
||||
const handleVariableNameBlur = useCallback((value: string) => {
|
||||
if (!value)
|
||||
const label = getFieldValue('label')
|
||||
if (!value || label)
|
||||
return
|
||||
setFieldValue('label', value)
|
||||
}, [setFieldValue])
|
||||
}, [getFieldValue, setFieldValue])
|
||||
|
||||
const handleDisplayNameBlur = useCallback((value: string) => {
|
||||
if (!value)
|
||||
|
|
|
|||
Loading…
Reference in New Issue