googlecodelabs / your-first-pwapp

Code associated with Your First Progressive Web App codelab
https://g.co/codelabs/pwa
Apache License 2.0
638 stars 555 forks source link

Icons do not update #91

Closed vued closed 5 years ago

vued commented 7 years ago

When the weather changes, the new icon property is added: card.querySelector('.current .icon').classList.add(app.getIconClass(current.code));

Since old properties are not removed, the icon does not change.

I fixed this by adding card.querySelector('.current .icon').classList.remove(...weatherIcons); and defining the weathericons as a varible var weatherIcons = ['partly-cloudy-day', 'cloudy', 'windy', 'fog', 'snow', 'thunderstorms', 'rain', 'clear-day']

petele commented 5 years ago

Hi!

Thanks for the feedback. I've rewritten the codelab from scratch and believe I have fixed this issue. The code has been updated, and the new guide is now live.

If you find any issues with the new codelab, please let us know!

Thanks!