Closed yuunster closed 11 months ago
since currentLocation variable is redefined during setUpMap(), and setUpMap() is only run during onMapReady(), the coordinates are only updated whenever the map is set up. This occurs during fragment creation as well as whenever the fragment is revisited. For example, if the user changes location, then navigates to a different fragment and then back to the map fragment, then onMapReady() will be run which will update the current coordinates. However, if the user changes location while on the map fragment and then logs a meal, their last saved location will be used (the last time the fragment was created/navigated to)
When logging a meal, uses the coordinates of the user when the app was first launched.
Solution: Fetch new coordinates when logging a meal