From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- app/components/workflow/hooks/use-workflow-variables.ts | 39 --------------------------------------- 1 files changed, 0 insertions(+), 39 deletions(-) diff --git a/app/components/workflow/hooks/use-workflow-variables.ts b/app/components/workflow/hooks/use-workflow-variables.ts index 35637bc..feadaf8 100644 --- a/app/components/workflow/hooks/use-workflow-variables.ts +++ b/app/components/workflow/hooks/use-workflow-variables.ts @@ -8,8 +8,6 @@ ValueSelector, Var, } from '@/app/components/workflow/types' -import { useIsChatMode } from './use-workflow' -import { useStoreApi } from 'reactflow' export const useWorkflowVariables = () => { const { t } = useTranslation() @@ -46,7 +44,6 @@ parentNode, valueSelector, isIterationItem, - isLoopItem, availableNodes, isChatMode, isConstant, @@ -54,7 +51,6 @@ valueSelector: ValueSelector parentNode?: Node | null isIterationItem?: boolean - isLoopItem?: boolean availableNodes: any[] isChatMode: boolean isConstant?: boolean @@ -63,7 +59,6 @@ parentNode, valueSelector, isIterationItem, - isLoopItem, availableNodes, isChatMode, isConstant, @@ -76,38 +71,4 @@ getNodeAvailableVars, getCurrentVariableType, } -} - -export const useWorkflowVariableType = () => { - const store = useStoreApi() - const { - getNodes, - } = store.getState() - const { getCurrentVariableType } = useWorkflowVariables() - - const isChatMode = useIsChatMode() - - const getVarType = ({ - nodeId, - valueSelector, - }: { - nodeId: string, - valueSelector: ValueSelector, - }) => { - const node = getNodes().find(n => n.id === nodeId) - const isInIteration = !!node?.data.isInIteration - const iterationNode = isInIteration ? getNodes().find(n => n.id === node.parentId) : null - const availableNodes = [node] - - const type = getCurrentVariableType({ - parentNode: iterationNode, - valueSelector, - availableNodes, - isChatMode, - isConstant: false, - }) - return type - } - - return getVarType } -- Gitblit v1.8.0