From 2a7dca6fc93ecdd5ab8540a9b43f06e981e39bac Mon Sep 17 00:00:00 2001 From: chanx <1243304602@qq.com> Date: Thu, 5 Feb 2026 15:57:38 +0800 Subject: [PATCH] Fix: parser bug (#13014) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …, clicking "Parse" will still ask if you want to clear the chunks of the already parsed files. ### What problem does this PR solve? Fix: After selecting all and then unchecking the already parsed files, clicking "Parse" will still ask if you want to clear the chunks of the already parsed files. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- .../pages/dataset/dataset/use-bulk-operate-dataset.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web/src/pages/dataset/dataset/use-bulk-operate-dataset.tsx b/web/src/pages/dataset/dataset/use-bulk-operate-dataset.tsx index a96c1ec6a..467ca1cb4 100644 --- a/web/src/pages/dataset/dataset/use-bulk-operate-dataset.tsx +++ b/web/src/pages/dataset/dataset/use-bulk-operate-dataset.tsx @@ -44,10 +44,12 @@ export function useBulkOperateDataset({ if (!documents.length) { return 0; } - return documents.reduce((acc, cur) => { - return acc + cur.chunk_num; - }, 0); - }, [documents]); + return documents + .filter((item) => selectedRowKeys.includes(item.id) && item.id) + ?.reduce((acc, cur) => { + return acc + cur.chunk_num; + }, 0); + }, [documents, selectedRowKeys]); const runDocument = useCallback( async (run: number, option?: { delete: boolean; apply_kb: boolean }) => {