fix nighttime icons on extended forecast close #134

This commit is contained in:
Matt Walsh
2025-08-11 22:35:03 -05:00
parent 5cc85840a9
commit 13ff0317e6

View File

@@ -137,10 +137,6 @@ const parse = (fullForecast, forecastUrl) => {
}
// get the object to modify/populate
const fDay = forecast[destIndex];
// high temperature will always be last in the source array so it will overwrite the low values assigned below
fDay.icon = getLargeIcon(period.icon);
fDay.text = shortenExtendedForecastText(period.shortForecast);
fDay.dayName = dates[destIndex];
// preload the icon
preloadImg(fDay.icon);
@@ -148,6 +144,9 @@ const parse = (fullForecast, forecastUrl) => {
if (period.isDaytime) {
// day time is the high temperature
fDay.high = period.temperature;
fDay.icon = getLargeIcon(period.icon);
fDay.text = shortenExtendedForecastText(period.shortForecast);
fDay.dayName = dates[destIndex];
// Wait for the corresponding night period to increment
} else {
// low temperature