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-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