Преглед изворни кода

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

MuYu пре 2 месеци
родитељ
комит
ab2e6c19a4

+ 2 - 1
web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx

@@ -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 })