From 5329dd0c637a58257ef472135b40c24b0eb1fa8e Mon Sep 17 00:00:00 2001 From: martmull Date: Tue, 28 Jan 2025 18:53:26 +0100 Subject: [PATCH] Disable variable picker when no available variables (#9894) - Disable variable picker when no available variables (https://discord.com/channels/1130383047699738754/1331236819227906049) image --- .../components/WorkflowVariablesDropdown.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx index 9a4aba81b..300da8040 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx @@ -47,6 +47,8 @@ export const WorkflowVariablesDropdown = ({ objectNameSingularToSelect, }); + const noAvailableVariables = availableVariablesInWorkflowStep.length === 0; + const initialStep = availableVariablesInWorkflowStep.length === 1 ? availableVariablesInWorkflowStep[0] @@ -72,11 +74,11 @@ export const WorkflowVariablesDropdown = ({ setSelectedStep(undefined); }; - if (disabled === true) { + if (disabled === true || noAvailableVariables) { return (