From fd050b33d911670571ffecd42b84d9242a99e8a5 Mon Sep 17 00:00:00 2001 From: jialin Date: Wed, 10 Jun 2026 15:34:08 +0800 Subject: [PATCH] fix: dedupe backend params when switching backend --- src/hooks/use-watch-list.ts | 2 +- .../components/deployment/deploy-builtin-modal.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hooks/use-watch-list.ts b/src/hooks/use-watch-list.ts index b45886d2..895adbee 100644 --- a/src/hooks/use-watch-list.ts +++ b/src/hooks/use-watch-list.ts @@ -55,7 +55,7 @@ export default function useWatchList>(API: string) { cacheWatchDataListRef.current = cacheWatchDataListRef.current.filter( (item) => item.id !== id ); - setWatchDataList(() => cacheWatchDataListRef.current); + setWatchDataList(cacheWatchDataListRef.current); }; const getAllDataList = useMemoizedFn(async () => { diff --git a/src/pages/llmodels/components/deployment/deploy-builtin-modal.tsx b/src/pages/llmodels/components/deployment/deploy-builtin-modal.tsx index 575bc215..606b1f0c 100644 --- a/src/pages/llmodels/components/deployment/deploy-builtin-modal.tsx +++ b/src/pages/llmodels/components/deployment/deploy-builtin-modal.tsx @@ -200,10 +200,10 @@ const AddModal: React.FC = (props) => { ?.default_backend_param || []; form.current?.setFieldsValue({ - backend_parameters: [ - ...defaultBackendParameters, - ...(form.current?.getFieldValue('backend_parameters') || []) - ] + backend_parameters: mergeBackendParameters( + defaultBackendParameters, + form.current?.getFieldValue('backend_parameters') || [] + ) }); handleCheckFormData();