mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 20:17:29 +08:00
fix loop var change cause collaboration crash
This commit is contained in:
parent
a300c9ef96
commit
ecaff5b63f
@ -41,6 +41,9 @@ const FormItem = ({
|
|||||||
}: FormItemProps) => {
|
}: FormItemProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { value_type, var_type, value } = item
|
const { value_type, var_type, value } = item
|
||||||
|
const normalizedVarValue = useMemo(() => {
|
||||||
|
return Array.isArray(value) ? value : []
|
||||||
|
}, [value])
|
||||||
|
|
||||||
const handleInputChange = useCallback((e: any) => {
|
const handleInputChange = useCallback((e: any) => {
|
||||||
onChange(e.target.value)
|
onChange(e.target.value)
|
||||||
@ -79,7 +82,7 @@ const FormItem = ({
|
|||||||
readonly={false}
|
readonly={false}
|
||||||
nodeId={nodeId}
|
nodeId={nodeId}
|
||||||
isShowNodeName
|
isShowNodeName
|
||||||
value={value}
|
value={normalizedVarValue}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
filterVar={filterVar}
|
filterVar={filterVar}
|
||||||
placeholder={t('workflow.nodes.assigner.setParameter') as string}
|
placeholder={t('workflow.nodes.assigner.setParameter') as string}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user