From 918c187c506c4c68b3ff706dc1fa7244308e0864 Mon Sep 17 00:00:00 2001 From: twwu Date: Thu, 11 Dec 2025 10:58:24 +0800 Subject: [PATCH] refactor: optimize clearDataSourceData function and update localFileList condition --- .../datasets/documents/create-from-pipeline/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/app/components/datasets/documents/create-from-pipeline/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/index.tsx index 73163110a3..79e3694da8 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/index.tsx @@ -421,11 +421,12 @@ const CreateFormPipeline = () => { }, [PagesMapAndSelectedPagesId, currentWorkspace?.pages, dataSourceStore, datasourceType]) const clearDataSourceData = useCallback((dataSource: Datasource) => { - if (dataSource.nodeData.provider_type === DatasourceType.onlineDocument) + const providerType = dataSource.nodeData.provider_type + if (providerType === DatasourceType.onlineDocument) clearOnlineDocumentData() - else if (dataSource.nodeData.provider_type === DatasourceType.websiteCrawl) + else if (providerType === DatasourceType.websiteCrawl) clearWebsiteCrawlData() - else if (dataSource.nodeData.provider_type === DatasourceType.onlineDrive) + else if (providerType === DatasourceType.onlineDrive) clearOnlineDriveData() }, [clearOnlineDocumentData, clearOnlineDriveData, clearWebsiteCrawlData]) @@ -512,7 +513,7 @@ const CreateFormPipeline = () => { tip={tip} /> { - !supportBatchUpload && localFileList.length > 0 && ( + !supportBatchUpload && datasourceType === DatasourceType.localFile && localFileList.length > 0 && ( <>