diff --git a/web/app/components/workflow-app/hooks/use-workflow-init.ts b/web/app/components/workflow-app/hooks/use-workflow-init.ts index 578e2f9121..a0a6cc22a1 100644 --- a/web/app/components/workflow-app/hooks/use-workflow-init.ts +++ b/web/app/components/workflow-app/hooks/use-workflow-init.ts @@ -18,18 +18,19 @@ import { import type { FetchWorkflowDraftResponse } from '@/types/workflow' import { useWorkflowConfig } from '@/service/use-workflow' import type { FileUploadConfigResponse } from '@/models/common' +import type { Edge, Node } from '@/app/components/workflow/types' import { BlockEnum } from '@/app/components/workflow/types' import { AppModeEnum } from '@/types/app' -const hasConnectedUserInput = (nodes: any[] = [], edges: any[] = []) => { +const hasConnectedUserInput = (nodes: Node[] = [], edges: Edge[] = []): boolean => { const startNodeIds = nodes .filter(node => node?.data?.type === BlockEnum.Start) - .map((node: any) => node.id) + .map(node => node.id) if (!startNodeIds.length) return false - return edges?.some((edge: any) => startNodeIds.includes(edge.source)) + return edges.some(edge => startNodeIds.includes(edge.source)) } export const useWorkflowInit = () => { const workflowStore = useWorkflowStore()