Fixes #13415 reset model-provider-page form value use schema.default (#13416)

This commit is contained in:
MuYu 2025-02-08 20:34:52 +08:00 committed by GitHub
parent f7959bc887
commit ab2e6c19a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,7 +61,8 @@ const Form: FC<FormProps> = ({
const shouldClearVariable: Record<string, string | undefined> = {}
if (showOnVariableMap[key]?.length) {
showOnVariableMap[key].forEach((clearVariable) => {
shouldClearVariable[clearVariable] = undefined
const schema = formSchemas.find(it => it.variable === clearVariable)
shouldClearVariable[clearVariable] = schema ? schema.default : undefined
})
}
onChange({ ...value, [key]: val, ...shouldClearVariable })