From aa2e2d84c8560ff540799bf191db10ce8c0d759c Mon Sep 17 00:00:00 2001 From: "lixinghua.vendor" Date: Wed, 9 Oct 2024 14:59:34 +0800 Subject: [PATCH] fix: LLMMulitWheel tool answer sort --- .../sidebar/components/modelAnswerSort/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/lb-components/src/components/LLMToolView/sidebar/components/modelAnswerSort/index.tsx b/packages/lb-components/src/components/LLMToolView/sidebar/components/modelAnswerSort/index.tsx index 243e4345..42d3aa85 100644 --- a/packages/lb-components/src/components/LLMToolView/sidebar/components/modelAnswerSort/index.tsx +++ b/packages/lb-components/src/components/LLMToolView/sidebar/components/modelAnswerSort/index.tsx @@ -53,7 +53,9 @@ export const getSorts = ({ return true; }); if (selecteds && selecteds?.length > 0) { - newSort = selecteds.map((i) => i.map((item) => modelList.find((j) => j.id === item))); + newSort = selecteds + .map((i) => i.map((item) => modelList.find((j) => j.id === item))?.filter((arr) => arr)) + ?.filter((arr) => arr?.length > 0); } return { waitSorts, newSort }; }; @@ -86,7 +88,7 @@ const ModelAnswerSort = (props: IProps, ref: any) => { }, [modelData, imgIndex]); useEffect(() => { - if (selectedSort) { + if (selectedSort && modelData.length > 0) { setRenderAnswerSortData(); } }, [modelData, imgIndex]);