Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboss committed Sep 11, 2024
1 parent 4b7126e commit 47f60f9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions web/src/features/fba/components/infoPanel/AdvisoryText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,12 @@ const AdvisoryText = ({
let endTime: number | undefined = undefined
for (const fuel of selectedFireZoneUnitTopFuels) {
if (!isUndefined(fuel.critical_hours.start_time)) {
if (isUndefined(startTime)) {
startTime = fuel.critical_hours.start_time
} else if (fuel.critical_hours.start_time < startTime) {
if (isUndefined(startTime) || fuel.critical_hours.start_time < startTime) {
startTime = fuel.critical_hours.start_time
}
}
if (!isUndefined(fuel.critical_hours.end_time)) {
if (isUndefined(endTime)) {
endTime = fuel.critical_hours.end_time
} else if (fuel.critical_hours.end_time > endTime) {
if (isUndefined(endTime) || fuel.critical_hours.end_time > endTime) {
endTime = fuel.critical_hours.end_time
}
}
Expand Down

0 comments on commit 47f60f9

Please sign in to comment.