mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 18:58:35 +08:00
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Wu Tianwei <30284043+WTW0313@users.noreply.github.com>
This commit is contained in:
parent
bbc31a3403
commit
38ea0de907
@ -2487,9 +2487,6 @@
|
||||
}
|
||||
},
|
||||
"web/app/components/datasets/create/website/jina-reader/index.tsx": {
|
||||
"eslint-react/set-state-in-effect": {
|
||||
"count": 1
|
||||
},
|
||||
"no-console": {
|
||||
"count": 1
|
||||
},
|
||||
|
||||
@ -3,7 +3,7 @@ import type { FC } from 'react'
|
||||
import type { CrawlOptions, CrawlResultItem } from '@/models/datasets'
|
||||
import { toast } from '@langgenius/dify-ui/toast'
|
||||
import * as React from 'react'
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { useCallback, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { ACCOUNT_SETTING_TAB } from '@/app/components/header/account-setting/constants'
|
||||
import { useIntegrationsSetting } from '@/app/components/header/account-setting/use-integrations-setting'
|
||||
@ -44,9 +44,6 @@ const JinaReader: FC<Props> = ({
|
||||
const { t } = useTranslation()
|
||||
const [step, setStep] = useState<Step>(Step.init)
|
||||
const [controlFoldOptions, setControlFoldOptions] = useState<number>(0)
|
||||
useEffect(() => {
|
||||
if (step !== Step.init) setControlFoldOptions(Date.now())
|
||||
}, [step])
|
||||
const openIntegrationsSetting = useIntegrationsSetting()
|
||||
const handleSetting = useCallback(() => {
|
||||
openIntegrationsSetting({
|
||||
@ -147,6 +144,9 @@ const JinaReader: FC<Props> = ({
|
||||
return
|
||||
}
|
||||
setStep(Step.running)
|
||||
// fold the options panel when the step leaves `init`,
|
||||
// previously synced via a setState in an effect on `step`
|
||||
setControlFoldOptions(Date.now())
|
||||
try {
|
||||
const startTime = Date.now()
|
||||
const res = (await createJinaReaderTask({
|
||||
@ -190,6 +190,7 @@ const JinaReader: FC<Props> = ({
|
||||
console.log(e)
|
||||
} finally {
|
||||
setStep(Step.finished)
|
||||
setControlFoldOptions(Date.now())
|
||||
}
|
||||
},
|
||||
[checkValid, crawlOptions, onCheckedCrawlResultChange, onJobIdChange, t, waitForCrawlFinished],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user