Skip to content

Comments

Update Zone Colors to be consistent with NAC#1081

Merged
stevekuznetsov merged 2 commits intoNWACus:mainfrom
kevinherdez:kevinherdez/zoneColorsUpdate
Feb 5, 2026
Merged

Update Zone Colors to be consistent with NAC#1081
stevekuznetsov merged 2 commits intoNWACus:mainfrom
kevinherdez:kevinherdez/zoneColorsUpdate

Conversation

@kevinherdez
Copy link
Collaborator

Grey: Out of Season
Blue: Information Exchange, General Avalanche Information product (current or expired), expired forecast.

(forecast.product_type === ProductType.Forecast || forecast.product_type === ProductType.Summary) &&
forecast.expires_time &&
(isAfter(toDate(new Date(forecast.expires_time), {timeZone: 'UTC'}), requestedTimeToUTCDate(requestedTime)) /* product is not expired */ ||
(zonesById[id].end_date &&
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check was after forecast.expires_time and before isAfter(toDate(new Date(forecast.expires_time), {timeZone: 'UTC'}), requestedTimeToUTCDate(requestedTime)) which meant that if there was a valid forecast for the zone, but the map layer information had end_date as null then we were existing before checking if the forecast was valid.

This seemed wrong, but I'm not 100% sure if the original intent is to bail early or not since end_date === null on the zone seems to be invalid

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly cant remember 100% but I do think that there was (is?) some weirdness for when the end date is set vs not. it is possible that when the forecast expires the end date may get nulled out or something like that or that a way to invalidate a forecast was setting end to null but I can also be making that up. . @stevekuznetsov is probably the better person to confirm this, since he approved this I assume what you have is correct 😄

@stevekuznetsov stevekuznetsov added this pull request to the merge queue Feb 5, 2026
Merged via the queue into NWACus:main with commit bebf465 Feb 5, 2026
5 checks passed
@kevinherdez kevinherdez deleted the kevinherdez/zoneColorsUpdate branch February 5, 2026 18:13
@rustynwac
Copy link

Tested and works on both devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants