From 2b97eebb74d23d2e721d237d01c71ca42259bfa7 Mon Sep 17 00:00:00 2001 From: arsforza Date: Mon, 22 Jan 2024 11:06:07 +0100 Subject: [PATCH] fix: use early returns AB#25833 --- .../src/app/services/map.service.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/interfaces/IBF-dashboard/src/app/services/map.service.ts b/interfaces/IBF-dashboard/src/app/services/map.service.ts index 0cc579303..f572bf4e1 100644 --- a/interfaces/IBF-dashboard/src/app/services/map.service.ts +++ b/interfaces/IBF-dashboard/src/app/services/map.service.ts @@ -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, + }; }; }