mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-24 21:45:21 +00:00
fix: guard against stale geocoding results on legacy devices
- Add isActive check after blocking Geocoder.getFromLocation call - Prevent stale results from overwriting state after job cancellation
This commit is contained in:
@@ -592,6 +592,8 @@ class LocationChannelManager private constructor(private val context: Context) {
|
||||
@Suppress("DEPRECATION")
|
||||
val addresses = geocoder.getFromLocation(location.latitude, location.longitude, 1)
|
||||
|
||||
if (!isActive) return@launch
|
||||
|
||||
if (!addresses.isNullOrEmpty()) {
|
||||
val address = addresses[0]
|
||||
val names = namesByLevel(address)
|
||||
|
||||
Reference in New Issue
Block a user