fix(android): refresh location cache on resume

This commit is contained in:
Daniel Arantes Loverde
2026-04-17 14:48:50 -03:00
parent 246e1a272b
commit 4587ec838f
2 changed files with 8 additions and 1 deletions

View File

@@ -88,6 +88,8 @@ open class MainActivity: AppCompatActivity {
override fun onResume() {
super.onResume()
AppDelegate.shared.onResume()
requestLocationPermissionsIfNeeded()
cacheLastKnownLocation()
}
override fun onPause() {
@@ -172,7 +174,7 @@ open class MainActivity: AppCompatActivity {
} catch (_: Exception) {
null
}
if (candidate != null && (best == null || candidate.accuracy < best!!.accuracy)) {
if (candidate != null && (best == null || candidate.accuracy < best.accuracy)) {
best = candidate
}
}