Fix: parser bug (#13014)

…, 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)
This commit is contained in:
chanx
2026-02-05 15:57:38 +08:00
committed by GitHub
parent 0a08fc7b07
commit 2a7dca6fc9

View File

@ -44,10 +44,12 @@ export function useBulkOperateDataset({
if (!documents.length) { if (!documents.length) {
return 0; return 0;
} }
return documents.reduce((acc, cur) => { return documents
.filter((item) => selectedRowKeys.includes(item.id) && item.id)
?.reduce((acc, cur) => {
return acc + cur.chunk_num; return acc + cur.chunk_num;
}, 0); }, 0);
}, [documents]); }, [documents, selectedRowKeys]);
const runDocument = useCallback( const runDocument = useCallback(
async (run: number, option?: { delete: boolean; apply_kb: boolean }) => { async (run: number, option?: { delete: boolean; apply_kb: boolean }) => {