fix requestLocationPermission on start

This commit is contained in:
Chumva 2018-08-20 14:15:25 +03:00
parent 4479f92a21
commit cade49f764

View file

@ -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
}