ResoCoder / forecast-mvvm-android-kotlin

Forecast MVVM app as found in the free course.
https://www.youtube.com/playlist?list=PLB6lc7nQ1n4jTLDyU2muTBo8xk0dg0D_w
339 stars 163 forks source link

Bug in hasCustomLocationChanged #6

Closed EkeKoseoglu closed 5 years ago

EkeKoseoglu commented 5 years ago

I guess, in the hasCustomLocationChanged function in the LocationProviderImpl class, it might be better to check whether or not the user is using device location and if not using, return customLocationName != lastWeatherLocation.name otherwise return false. The current implementation of hasCustomLocationChanged function returns always true and that's why fetchCurrentWeather function is triggered even if using device location.

ResoDev commented 5 years ago

This is a perfectly reasonable thing to do. Thanks for noticing it and letting me know!