Skip to content

Commit

Permalink
fix: use early returns AB#25833
Browse files Browse the repository at this point in the history
  • Loading branch information
arsforza committed Jan 22, 2024
1 parent 1f75b79 commit 2b97eeb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions interfaces/IBF-dashboard/src/app/services/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1011,26 +1011,26 @@ export class MapService {
color: triggered ? this.triggeredAreaColor : this.nonTriggeredAreaColor,
weight: 5,
};
} else if (area.stopped) {
}
if (area.stopped) {
return {
color: this.stoppedTriggerColor,
weight: 5,
};
} else if (!area.triggerValue || area.triggerValue < 1) {
return {
color: this.nonTriggeredAreaColor,
weight: 5,
};
} else if (!this.eventState?.event?.thresholdReached) {
}
if (
!area.triggerValue ||
area.triggerValue < 1 ||
!this.eventState?.event?.thresholdReached
) {
return {
color: this.nonTriggeredAreaColor,
weight: 5,
};
} else {
return {
color: this.triggeredAreaColor,
weight: 5,
};
}
return {
color: this.triggeredAreaColor,
weight: 5,
};
};
}

0 comments on commit 2b97eeb

Please sign in to comment.