From 4061b119227af2e564f73e0c884e81921c2cb386 Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Thu, 31 Oct 2024 17:25:02 +0800 Subject: [PATCH] fix: dataset select check (#3048) --- .../core/app/DatasetSelectModal.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/projects/app/src/components/core/app/DatasetSelectModal.tsx b/projects/app/src/components/core/app/DatasetSelectModal.tsx index 418d19fe224e..7e3584581b66 100644 --- a/projects/app/src/components/core/app/DatasetSelectModal.tsx +++ b/projects/app/src/components/core/app/DatasetSelectModal.tsx @@ -55,6 +55,9 @@ export const DatasetSelectModal = ({ ) }; }, [datasets, allDatasets, selectedDatasets]); + const activeVectorModel = allDatasets.find( + (dataset) => dataset._id === selectedDatasets[0]?.datasetId + )?.vectorModel?.model; return ( dataset._id === selectedDatasets[0]?.datasetId - )?.vectorModel?.model; - - if (vectorModel && vectorModel !== item.vectorModel.model) { + if (activeVectorModel && activeVectorModel !== item.vectorModel.model) { return toast({ status: 'warning', title: t('common:dataset.Select Dataset Tips') @@ -168,13 +167,20 @@ export const DatasetSelectModal = ({ {item.name} - + {item.type === DatasetTypeEnum.folder ? ( {t('common:Folder')} ) : ( <> - {item.vectorModel.name} + {item.vectorModel.name} )}