Skip to content

Commit

Permalink
Fix ITMGeolocationManager crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdasSorys committed Oct 16, 2024
1 parent d8243fa commit 09af604
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ class ITMGeolocationManager(private var context: Context, private val errorHandl

@JavascriptInterface
fun clearWatch(positionId: Int) {
watchIds.remove(positionId)
if (watchIds.isEmpty()) {
stopLocationUpdates()
mainScope.launch {
watchIds.remove(positionId)
if (watchIds.isEmpty()) {
stopLocationUpdates()
}
}
}
}
Expand Down

0 comments on commit 09af604

Please sign in to comment.