mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 19:27:23 +08:00
fix: update condition for handling datasource selection in DataSourceOptions
This commit is contained in:
parent
8e4165defe
commit
5193fa2118
@ -26,7 +26,7 @@ const DataSourceOptions = ({
|
|||||||
}, [datasources, onSelect])
|
}, [datasources, onSelect])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (options.length > 0)
|
if (options.length > 0 && !datasourceNodeId)
|
||||||
handelSelect(options[0].value)
|
handelSelect(options[0].value)
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [])
|
}, [])
|
||||||
|
|||||||
@ -22,7 +22,7 @@ const DataSourceOptions = ({
|
|||||||
}, [datasources, onSelect])
|
}, [datasources, onSelect])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (options.length > 0)
|
if (options.length > 0 && !dataSourceNodeId)
|
||||||
handelSelect(options[0].value)
|
handelSelect(options[0].value)
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [])
|
}, [])
|
||||||
|
|||||||
@ -242,7 +242,7 @@ const FileUploader = ({
|
|||||||
}, [handleDrop])
|
}, [handleDrop])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className='flex flex-col'>
|
||||||
{!hideUpload && (
|
{!hideUpload && (
|
||||||
<input
|
<input
|
||||||
ref={fileUploader}
|
ref={fileUploader}
|
||||||
|
|||||||
@ -101,7 +101,7 @@ const Crawler = ({
|
|||||||
}, [runDatasourceNode, nodeId, pipelineId, onJobIdChange, onCheckedCrawlResultChange, t])
|
}, [runDatasourceNode, nodeId, pipelineId, onJobIdChange, onCheckedCrawlResultChange, t])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className='flex flex-col'>
|
||||||
<Header
|
<Header
|
||||||
isInPipeline
|
isInPipeline
|
||||||
{...headerInfo}
|
{...headerInfo}
|
||||||
@ -117,7 +117,7 @@ const Crawler = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{!isInit && (
|
{!isInit && (
|
||||||
<div className='relative'>
|
<div className='relative flex flex-col'>
|
||||||
{isRunning && (
|
{isRunning && (
|
||||||
<Crawling
|
<Crawling
|
||||||
crawledNum={0}
|
crawledNum={0}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user