Skip to content

Commit aed85d5

Browse files
petrapazkresimir-coko
authored andcommitted
4822 - replace sequential find calls with single pass over combined operations array
1 parent f267bce commit aed85d5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

client/src/pages/platform/workflow-editor/components/datapills/DataPillPanelBodyPropertiesItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ const DataPillPanelBodyPropertiesItem = ({
7878
title = operation.taskDispatcherDefinition.title;
7979
}
8080

81-
const workflowNodeLabel =
82-
workflow?.tasks?.find((task) => task.name === workflowNodeName)?.label ||
83-
workflow?.triggers?.find((trigger) => trigger.name === workflowNodeName)?.label;
81+
const workflowNodeLabel = [...(workflow?.tasks ?? []), ...(workflow?.triggers ?? [])].find(
82+
(operation) => operation.name === workflowNodeName
83+
)?.label;
8484

8585
const currentWorkflowNode = workflowNodes.find(
8686
(workflowNode) => workflowNode.workflowNodeName === workflowNodeName

0 commit comments

Comments
 (0)