Loading cardinal-android/app/src/main/java/earth/maps/cardinal/data/LocationRepository.kt +8 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ class LocationRepository @Inject constructor( cachedLocation?.let { location -> if (isLocationRecent(location, currentTime)) { _locationFlow.value = location return location } } Loading Loading @@ -465,6 +466,13 @@ class LocationRepository @Inject constructor( } catch (_: Exception) { // Ignore exceptions during cleanup } // This location will be used as if it's fresh by the caller, for e.g. a camera animateTo // operation. In order for the location puck to match the location we're animating to, it // makes sense to update the locationFlow too. This is "incorrect" because the last known // location is potentially stale and the location flow is supposed to contain fresh // locations, but if we're timing out while requesting a location, the locationFlow is // already stale to begin with, or more likely, empty. lastKnownLocation?.let { _locationFlow.value = it } locationDeferred.complete(lastKnownLocation) } } Loading Loading
cardinal-android/app/src/main/java/earth/maps/cardinal/data/LocationRepository.kt +8 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ class LocationRepository @Inject constructor( cachedLocation?.let { location -> if (isLocationRecent(location, currentTime)) { _locationFlow.value = location return location } } Loading Loading @@ -465,6 +466,13 @@ class LocationRepository @Inject constructor( } catch (_: Exception) { // Ignore exceptions during cleanup } // This location will be used as if it's fresh by the caller, for e.g. a camera animateTo // operation. In order for the location puck to match the location we're animating to, it // makes sense to update the locationFlow too. This is "incorrect" because the last known // location is potentially stale and the location flow is supposed to contain fresh // locations, but if we're timing out while requesting a location, the locationFlow is // already stale to begin with, or more likely, empty. lastKnownLocation?.let { _locationFlow.value = it } locationDeferred.complete(lastKnownLocation) } } Loading