File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import MessageUtil from "@/util/MessageUtil";
2020import { useMst } from "@/views/stores/RootStore" ;
2121import getModelShowName from "@/util/getModelShowName" ;
2222import isEqual from "lodash.isequal" ;
23+ import cloneDeep from "lodash.clonedeep" ;
2324import { useTranslation } from "react-i18next" ;
2425import { useDisclosure } from "@mantine/hooks" ;
2526import { observer } from "mobx-react-lite" ;
@@ -70,7 +71,7 @@ const Config = function () {
7071 initialValues : {
7172 providers : { } ,
7273 models : { } ,
73- ...config . config ,
74+ ...cloneDeep ( config . config ) ,
7475 } ,
7576 validate : {
7677 providers : {
@@ -105,7 +106,8 @@ const Config = function () {
105106
106107 useEffect ( ( ) => {
107108 if ( router . currentRoute !== "config" ) return ;
108- form . setValues ( config . config ) ;
109+ const cloneConfig = cloneDeep ( config . config ) ;
110+ form . setValues ( cloneConfig ) ;
109111 if ( config . settle && loading ) {
110112 setTimeout ( ( ) => {
111113 router . updateRoute ( "chat" ) ;
@@ -224,6 +226,7 @@ const Config = function () {
224226 description = { t ( "the base URL for the API" ) }
225227 { ...form . getInputProps ( "providers.devchat.api_base" ) }
226228 />
229+
227230 < PasswordInput
228231 styles = { commonInputStyle }
229232 sx = { {
You can’t perform that action at this time.
0 commit comments