Skip to content

Commit

Permalink
Go to the devices location when the tower map is first opened and the…
Browse files Browse the repository at this point in the history
… info dialog is accepted
  • Loading branch information
christianrowlands committed Oct 16, 2024
1 parent c5c4de6 commit c28301f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ class TowerMapFragment : AServiceDataFragment(), MenuProvider, ICellularSurveyRe
val initialLocation = service.primaryLocationListener?.latestLocation
initialLocation?.let {
if (viewModel == null) {
removeListener = true
removeListener = false
} else {
removeListener = viewModel!!.updateLocation(it)
}

}

if (!removeListener) {
locationListener = LocationListener { location ->
if (viewModel == null) return@LocationListener
removeListener = viewModel!!.updateLocation(location)
if (removeListener) service.unregisterLocationListener(locationListener)
}
Expand Down

0 comments on commit c28301f

Please sign in to comment.