瀏覽代碼

retention of data filled on tab switch for tool plugin (#23323)

tags/1.7.2
znn 3 月之前
父節點
當前提交
d470120a60
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 20 行新增2 行删除
  1. 20
    2
      web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx

+ 20
- 2
web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx 查看文件

@@ -357,8 +357,26 @@ const VarReferencePicker: FC<Props> = ({
options: dynamicOptions,
}
}
return schema
}, [dynamicOptions])

// If we don't have dynamic options but we have a selected value, create a temporary option to preserve the selection during loading
if (isLoading && value && typeof value === 'string') {
const preservedOptions = [{
value,
label: { en_US: value, zh_Hans: value },
show_on: [],
}]
return {
...schema,
options: preservedOptions,
}
}

// Default case: return schema with empty options
return {
...schema,
options: [],
}
}, [schema, dynamicOptions, isLoading, value])

const variableCategory = useMemo(() => {
if (isEnv) return 'environment'

Loading…
取消
儲存