fix: update form values when switching model、size, #2191

This commit is contained in:
jialin
2025-07-02 20:34:48 +08:00
parent 6c2da264db
commit c8933a6669
3 changed files with 25 additions and 17 deletions
@@ -11,6 +11,7 @@ import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import styled from 'styled-components';
import {
backendOptionsMap,
defaultFormValues,
getSourceRepoConfigValue,
modelSourceMap
} from '../config';
@@ -310,7 +311,8 @@ const AddModal: FC<AddModalProps> = (props) => {
});
updateSelectedModel(item);
form.current?.form?.resetFields(resetFieldsByModel);
// TODO
form.current?.form?.setFieldsValue(defaultFormValues);
const modelInfo = onSelectModel(item, props.source);
form.current?.setFieldsValue?.({
...modelInfo,