From 77950e48c76f4a3b29d01831d43039caba29888a Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 18 十一月 2025 14:12:42 +0800
Subject: [PATCH] 修改
---
app/components/workflow/hooks/use-nodes-data.ts | 23 ++++-------------------
1 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/app/components/workflow/hooks/use-nodes-data.ts b/app/components/workflow/hooks/use-nodes-data.ts
index aeb45dd..3017f50 100644
--- a/app/components/workflow/hooks/use-nodes-data.ts
+++ b/app/components/workflow/hooks/use-nodes-data.ts
@@ -31,7 +31,7 @@
}), [t, isChatMode])
}
-export const useAvailableBlocks = (nodeType?: BlockEnum, isInIteration?: boolean, isInLoop?: boolean) => {
+export const useAvailableBlocks = (nodeType?: BlockEnum, isInIteration?: boolean) => {
const nodesExtraData = useNodesExtraData()
const availablePrevBlocks = useMemo(() => {
if (!nodeType)
@@ -42,36 +42,21 @@
const availableNextBlocks = useMemo(() => {
if (!nodeType)
return []
-
return nodesExtraData[nodeType].availableNextNodes || []
}, [nodeType, nodesExtraData])
return useMemo(() => {
return {
availablePrevBlocks: availablePrevBlocks.filter((nType) => {
- if (isInIteration && (nType === BlockEnum.Iteration || nType === BlockEnum.Loop || nType === BlockEnum.End))
+ if (isInIteration && (nType === BlockEnum.Iteration || nType === BlockEnum.End))
return false
-
- if (isInLoop && (nType === BlockEnum.Iteration || nType === BlockEnum.Loop || nType === BlockEnum.End))
- return false
-
- if (!isInLoop && nType === BlockEnum.LoopEnd)
- return false
-
return true
}),
availableNextBlocks: availableNextBlocks.filter((nType) => {
- if (isInIteration && (nType === BlockEnum.Iteration || nType === BlockEnum.Loop || nType === BlockEnum.End))
+ if (isInIteration && (nType === BlockEnum.Iteration || nType === BlockEnum.End))
return false
-
- if (isInLoop && (nType === BlockEnum.Iteration || nType === BlockEnum.Loop || nType === BlockEnum.End))
- return false
-
- if (!isInLoop && nType === BlockEnum.LoopEnd)
- return false
-
return true
}),
}
- }, [isInIteration, availablePrevBlocks, availableNextBlocks, isInLoop])
+ }, [isInIteration, availablePrevBlocks, availableNextBlocks])
}
--
Gitblit v1.8.0