mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 11:04:27 +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": {
|
"web/app/components/datasets/create/website/jina-reader/index.tsx": {
|
||||||
"eslint-react/set-state-in-effect": {
|
|
||||||
"count": 1
|
|
||||||
},
|
|
||||||
"no-console": {
|
"no-console": {
|
||||||
"count": 1
|
"count": 1
|
||||||
},
|
},
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import type { FC } from 'react'
|
|||||||
import type { CrawlOptions, CrawlResultItem } from '@/models/datasets'
|
import type { CrawlOptions, CrawlResultItem } from '@/models/datasets'
|
||||||
import { toast } from '@langgenius/dify-ui/toast'
|
import { toast } from '@langgenius/dify-ui/toast'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { ACCOUNT_SETTING_TAB } from '@/app/components/header/account-setting/constants'
|
import { ACCOUNT_SETTING_TAB } from '@/app/components/header/account-setting/constants'
|
||||||
import { useIntegrationsSetting } from '@/app/components/header/account-setting/use-integrations-setting'
|
import { useIntegrationsSetting } from '@/app/components/header/account-setting/use-integrations-setting'
|
||||||
@ -44,9 +44,6 @@ const JinaReader: FC<Props> = ({
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const [step, setStep] = useState<Step>(Step.init)
|
const [step, setStep] = useState<Step>(Step.init)
|
||||||
const [controlFoldOptions, setControlFoldOptions] = useState<number>(0)
|
const [controlFoldOptions, setControlFoldOptions] = useState<number>(0)
|
||||||
useEffect(() => {
|
|
||||||
if (step !== Step.init) setControlFoldOptions(Date.now())
|
|
||||||
}, [step])
|
|
||||||
const openIntegrationsSetting = useIntegrationsSetting()
|
const openIntegrationsSetting = useIntegrationsSetting()
|
||||||
const handleSetting = useCallback(() => {
|
const handleSetting = useCallback(() => {
|
||||||
openIntegrationsSetting({
|
openIntegrationsSetting({
|
||||||
@ -147,6 +144,9 @@ const JinaReader: FC<Props> = ({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
setStep(Step.running)
|
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 {
|
try {
|
||||||
const startTime = Date.now()
|
const startTime = Date.now()
|
||||||
const res = (await createJinaReaderTask({
|
const res = (await createJinaReaderTask({
|
||||||
@ -190,6 +190,7 @@ const JinaReader: FC<Props> = ({
|
|||||||
console.log(e)
|
console.log(e)
|
||||||
} finally {
|
} finally {
|
||||||
setStep(Step.finished)
|
setStep(Step.finished)
|
||||||
|
setControlFoldOptions(Date.now())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[checkValid, crawlOptions, onCheckedCrawlResultChange, onJobIdChange, t, waitForCrawlFinished],
|
[checkValid, crawlOptions, onCheckedCrawlResultChange, onJobIdChange, t, waitForCrawlFinished],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user