fix: update condition for handling datasource selection in DataSourceOptions

pull/21398/head
twwu 10 months ago
parent 8e4165defe
commit 5193fa2118

@ -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
}, [])

@ -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
}, [])

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

@ -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}

Loading…
Cancel
Save