diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/MainActivity.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/MainActivity.kt index e1b41b3c0f..a307f301a9 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/MainActivity.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/MainActivity.kt @@ -148,8 +148,6 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene if (AndroidUtils.isLocationPermissionAvailable(this)) { app.locationProvider.resumeAllUpdates() - } else { - AndroidUtils.requestLocationPermission(this) } if (settings.hasAnyChatToShowOnMap() && !isOsmAndInstalled()) { showOsmandMissingDialog() @@ -189,7 +187,14 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene telegramHelper.init() telegramHelper.requestAuthorizationState() } - TelegramAuthorizationState.READY -> LoginDialogFragment.dismiss(fm) + TelegramAuthorizationState.READY -> { + LoginDialogFragment.dismiss(fm) + if (AndroidUtils.isLocationPermissionAvailable(this)) { + app.locationProvider.resumeAllUpdates() + } else { + AndroidUtils.requestLocationPermission(this) + } + } else -> Unit }