fix: update condition for handling datasource selection in DataSourceOptions

This commit is contained in:
twwu 2025-06-06 11:43:00 +08:00
parent 8e4165defe
commit 5193fa2118
4 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ const DataSourceOptions = ({
}, [datasources, onSelect])
useEffect(() => {
if (options.length > 0)
if (options.length > 0 && !datasourceNodeId)
handelSelect(options[0].value)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

View File

@ -22,7 +22,7 @@ const DataSourceOptions = ({
}, [datasources, onSelect])
useEffect(() => {
if (options.length > 0)
if (options.length > 0 && !dataSourceNodeId)
handelSelect(options[0].value)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

View File

@ -242,7 +242,7 @@ const FileUploader = ({
}, [handleDrop])
return (
<div>
<div className='flex flex-col'>
{!hideUpload && (
<input
ref={fileUploader}

View File

@ -101,7 +101,7 @@ const Crawler = ({
}, [runDatasourceNode, nodeId, pipelineId, onJobIdChange, onCheckedCrawlResultChange, t])
return (
<div>
<div className='flex flex-col'>
<Header
isInPipeline
{...headerInfo}
@ -117,7 +117,7 @@ const Crawler = ({
/>
</div>
{!isInit && (
<div className='relative'>
<div className='relative flex flex-col'>
{isRunning && (
<Crawling
crawledNum={0}