From 544ebde0549c0ceab1ca377686cfc016cde46cc5 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 24 Jul 2025 15:05:09 +0800 Subject: [PATCH] chore: if bool value problem --- .../if-else/components/condition-list/condition-item.tsx | 4 ++++ web/app/components/workflow/nodes/if-else/utils.ts | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx index c25f082781..4bf2295158 100644 --- a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx +++ b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx @@ -204,8 +204,12 @@ const ConditionItem = ({ }, [caseId, condition, conditionId, isSubVariableKey, onRemoveCondition, onRemoveSubVariableCondition]) const handleVarChange = useCallback((valueSelector: ValueSelector, varItem: Var) => { + const { + conversationVariables, + } = workflowStore.getState() const resolvedVarType = getVarType({ valueSelector, + conversationVariables, availableNodes, isChatMode, }) diff --git a/web/app/components/workflow/nodes/if-else/utils.ts b/web/app/components/workflow/nodes/if-else/utils.ts index de01498d04..b747294a83 100644 --- a/web/app/components/workflow/nodes/if-else/utils.ts +++ b/web/app/components/workflow/nodes/if-else/utils.ts @@ -107,6 +107,13 @@ export const getOperators = (type?: VarType, file?: { key: string }) => { ComparisonOperator.empty, ComparisonOperator.notEmpty, ] + case VarType.boolean: + return [ + ComparisonOperator.is, + ComparisonOperator.isNot, + ComparisonOperator.empty, + ComparisonOperator.notEmpty, + ] case VarType.file: return [ ComparisonOperator.exists, @@ -114,6 +121,7 @@ export const getOperators = (type?: VarType, file?: { key: string }) => { ] case VarType.arrayString: case VarType.arrayNumber: + case VarType.arrayBoolean: return [ ComparisonOperator.contains, ComparisonOperator.notContains,