ソースを参照

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

MuYu 5 ヶ月 前
コミット
ab2e6c19a4
共有1 個のファイルを変更した2 個の追加1 個の削除を含む
  1. 2 1
      web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx

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