chore:extract last run common logic (#22214)

This commit is contained in:
Joel
2025-07-11 16:41:25 +08:00
committed by GitHub
parent 2a85f28963
commit 1d85979a74
6 changed files with 275 additions and 237 deletions

View File

@@ -15,7 +15,7 @@ import {
useWorkflowRun,
useWorkflowStartRun,
} from '../hooks'
import { useWorkflowStore } from '@/app/components/workflow/store'
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
type WorkflowMainProps = Pick<WorkflowProps, 'nodes' | 'edges' | 'viewport'>
const WorkflowMain = ({
@@ -64,7 +64,11 @@ const WorkflowMain = ({
handleWorkflowStartRunInChatflow,
handleWorkflowStartRunInWorkflow,
} = useWorkflowStartRun()
const { fetchInspectVars } = useSetWorkflowVarsWithValue()
const appId = useStore(s => s.appId)
const { fetchInspectVars } = useSetWorkflowVarsWithValue({
flowId: appId,
...useConfigsMap(),
})
const {
hasNodeInspectVars,
hasSetInspectVar,