Skip to content

Commit

Permalink
use 'is' to substitute conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ptyin committed Mar 16, 2024
1 parent 5cf0642 commit 45e4868
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions saga/seata-saga-statemachine-designer/src/spec/style/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export default class Node extends BaseSpec {
adjList.get(currentState).forEach((neighbor) => {
if (neighbor.style === undefined) {
neighbor.style = {};
if ((neighbor.Type === 'Fail') || (neighbor.Type === 'Succeed')) {
if (is(neighbor, 'End')) {
const target = [];
target.push(currentState.style.bounds.x + 150, currentState.style.bounds.y);
if (this.isElementPresent(visited, target)) {
Expand Down Expand Up @@ -394,7 +394,7 @@ export default class Node extends BaseSpec {
DEFAULT_HEIGHT,
);
}
} else if (neighbor.Type === 'CompensationTrigger') {
} else if (is(neighbor, 'CompensationTrigger')) {
setBounds(
neighbor,
currentState.style.bounds.x,
Expand All @@ -404,7 +404,7 @@ export default class Node extends BaseSpec {
);
const { Name } = neighbor;
queue.push(definitions.States[Name]);
} else if (neighbor.Type === 'Choice') {
} else if (is(neighbor, 'Choice')) {
setBounds(
neighbor,
currentState.style.bounds.x + 150,
Expand Down

0 comments on commit 45e4868

Please sign in to comment.