From fdc4c36b77e6f70a1be391f71be67d67c6831bcb Mon Sep 17 00:00:00 2001 From: twwu Date: Thu, 5 Jun 2025 14:05:27 +0800 Subject: [PATCH] refactor: replace useStore with useDatasetDetailContextWithSelector for pipeline ID retrieval --- .../panel/test-run/data-source/website-crawl/base/crawler.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/base/crawler.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/base/crawler.tsx index 4c598bfc10..741f5bfcc4 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/base/crawler.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/base/crawler.tsx @@ -12,7 +12,7 @@ import { useDraftPipelinePreProcessingParams, usePublishedPipelineProcessingParams, } from '@/service/use-pipeline' -import { useStore } from '@/app/components/workflow/store' +import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail' const I18N_PREFIX = 'datasetCreation.stepOne.website' @@ -48,7 +48,7 @@ const Crawler = ({ const { t } = useTranslation() const [step, setStep] = useState(Step.init) const [controlFoldOptions, setControlFoldOptions] = useState(0) - const pipelineId = useStore(s => s.pipelineId) + const pipelineId = useDatasetDetailContextWithSelector(s => s.dataset?.pipeline_id) const usePreProcessingParams = useRef(usingPublished ? usePublishedPipelineProcessingParams : useDraftPipelinePreProcessingParams) const { data: paramsConfig } = usePreProcessingParams.current({