mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-08-08 06:46:11 +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:
parent
77f97310b5
commit
4810a23b11
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user