Skip to content

Commit

Permalink
fix IfCondition wrong node name problem
Browse files Browse the repository at this point in the history
  • Loading branch information
yeze322 committed Feb 21, 2020
1 parent a0c7c94 commit 9af7281
Showing 1 changed file with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const IfConditionWidget: FunctionComponent<IfConditionWidgetProps> = ({
const { layout, updateNodeBoundary } = useSmartLayout(nodeMap, calculateIfElseLayout, onResize);

const { boundary, edges } = layout;
const { conditionNode, choiceNode, ifBranchNode, elseBranchNode } = nodeMap;
const { conditionNode, choiceNode } = nodeMap;

return (
<div css={{ width: boundary.width, height: boundary.height, position: 'relative' }}>
Expand All @@ -83,19 +83,22 @@ export const IfConditionWidget: FunctionComponent<IfConditionWidgetProps> = ({
}}
/>
</OffsetContainer>
{[ifBranchNode, elseBranchNode].map(x => (
<OffsetContainer key={`${x.id}/offset`} offset={x.offset}>
<StepGroup
key={x.id}
id={x.id}
data={x.data}
onEvent={onEvent}
onResize={size => {
updateNodeBoundary(IfElseNodes.IfBranch, size);
}}
/>
</OffsetContainer>
))}
{[IfElseNodes.IfBranch, IfElseNodes.ElseBranch].map(nodeName => {
const node = nodeMap[nodeName];
return (
<OffsetContainer key={`${node.id}/offset`} offset={node.offset}>
<StepGroup
key={node.id}
id={node.id}
data={node.data}
onEvent={onEvent}
onResize={size => {
updateNodeBoundary(nodeName, size);
}}
/>
</OffsetContainer>
);
})}
<SVGContainer>{Array.isArray(edges) ? edges.map(x => renderEdge(x)) : null}</SVGContainer>
</div>
);
Expand Down

0 comments on commit 9af7281

Please sign in to comment.