JulianNorton / weather-10kb-wxkb

Weather forecast that's high performance and accessible
https://wxkb.juliannorton.com
GNU General Public License v2.0
152 stars 49 forks source link

Changing units does not update units on first click #188

Closed JulianNorton closed 7 years ago

JulianNorton commented 7 years ago

What's the current situation?

  1. Load a location: https://wxkb.io/10025
  2. Click a different unit (F°, mph to C°, mph)
  3. Units on page are not updated.
  4. Clicking again on the button will update the values.

What do you recommend?

Units should change and update the page on first click.

I think this is caused by sw.js. Recommend looking at: https://github.com/JulianNorton/weather-10kb/blob/master/public/sw-registration.js#L2

tv1ster commented 7 years ago

I've got 403 while trying to run project locally, so i made fixes in sw-registration.js which should avoid registartion few separate window.onload listeners. Please test and inform, will it fix issue, or not

JulianNorton commented 7 years ago

Thanks @tv1ster for the fix, now on production:

https://github.com/JulianNorton/weather-10kb/pull/189

If you think it could be improved, please feel free to open a new issue.