From 97056dad308c361f159b55f14964afc2df7d93a2 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 10 Sep 2024 11:54:34 +0800 Subject: [PATCH] fix: file type var match page crash --- .../workflow/nodes/_base/components/variable/utils.ts | 4 ++-- .../components/workflow/nodes/_base/hooks/use-one-step-run.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/variable/utils.ts b/web/app/components/workflow/nodes/_base/components/variable/utils.ts index 5a7e7886fa..7a1fbdb7f8 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -421,7 +421,7 @@ const getIterationItemType = ({ arrayType = curr?.type } else { - if (curr?.type === VarType.object) + if (curr?.type === VarType.object || curr?.type === VarType.file) curr = curr.children } }) @@ -516,7 +516,7 @@ export const getVarType = ({ type = curr?.type } else { - if (curr?.type === VarType.object) + if (curr?.type === VarType.object || curr?.type === VarType.file) curr = curr.children } }) diff --git a/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts b/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts index 0a6a7a9c1b..8876ab0058 100644 --- a/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts +++ b/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts @@ -123,7 +123,7 @@ const useOneStepRun = ({ res = curr } else { - if (curr?.type === VarType.object) + if (curr?.type === VarType.object || curr?.type === VarType.file) curr = curr.children } })