penguin-teal / gnome-openweather

A GNOME Shell extension to show the weather of any location on Earth.
GNU General Public License v3.0
58 stars 18 forks source link

Fix repeat of day in forecast view #75

Open e2e8 opened 2 months ago

e2e8 commented 2 months ago

When using openweathermap, the previous code would repeat the forecast for a time slot when the forecast data would roll over from one day into the next. This pr fixes that issue by letting the loop go onto the next iteration to pick up the data from the first index of the next day.

For example if it would try to get this.#forecasts[0][8], the old code would reset it to this.#forecasts[0][7] instead of letting it roll over to this.#forecasts[1][0] which is where the correct data really is.

Example of the issue: error Fixed: fixed

This may address #30

penguin-teal commented 2 months ago

Looks good, I will merge this soon.