fix: remove unreachable polling from artifacts-section

The Skill view is locked (ViewPicker disabled) while a workflow
is running or chatflow is responding, so ArtifactsSection is never
mounted during runs. Polling there is dead code.
This commit is contained in:
yyh
2026-02-04 17:31:44 +08:00
parent 625163705b
commit 2df0d540a9

View File

@@ -7,7 +7,6 @@ import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import FolderSpark from '@/app/components/base/icons/src/vender/workflow/FolderSpark'
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
import { WorkflowRunningStatus } from '@/app/components/workflow/types'
import { useDownloadSandboxFile, useSandboxFilesTree } from '@/service/use-sandbox-file'
import { cn } from '@/utils/classnames'
import { downloadUrl } from '@/utils/download'
@@ -22,14 +21,8 @@ const ArtifactsSection = ({ className }: ArtifactsSectionProps) => {
const appId = useStore(s => s.appId)
const [isExpanded, setIsExpanded] = useState(false)
const isWorkflowRunning = useStore(
s => s.workflowRunningData?.result?.status === WorkflowRunningStatus.Running,
)
const isResponding = useStore(s => s.isResponding)
const { data: treeData, hasFiles, isLoading } = useSandboxFilesTree(appId, {
refetchInterval: (isWorkflowRunning || isResponding) ? 5000 : false,
})
const { data: treeData, hasFiles, isLoading } = useSandboxFilesTree(appId)
const { mutateAsync: fetchDownloadUrl, isPending: isDownloading } = useDownloadSandboxFile(appId)
const storeApi = useWorkflowStore()