Update Zone Colors to be consistent with NAC#1081
Update Zone Colors to be consistent with NAC#1081stevekuznetsov merged 2 commits intoNWACus:mainfrom
Conversation
| (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 && |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 😄
|
Tested and works on both devices. |
This PR brings our zone colors in line with what is on the NAC widget when it comes to whether a zone should be blue or grey
Grey: Out of Season
Blue: Information Exchange, General Avalanche Information product (current or expired), expired forecast.