fix requestLocationPermission on start
This commit is contained in:
parent
4479f92a21
commit
cade49f764
1 changed files with 8 additions and 3 deletions
|
@ -148,8 +148,6 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene
|
||||||
|
|
||||||
if (AndroidUtils.isLocationPermissionAvailable(this)) {
|
if (AndroidUtils.isLocationPermissionAvailable(this)) {
|
||||||
app.locationProvider.resumeAllUpdates()
|
app.locationProvider.resumeAllUpdates()
|
||||||
} else {
|
|
||||||
AndroidUtils.requestLocationPermission(this)
|
|
||||||
}
|
}
|
||||||
if (settings.hasAnyChatToShowOnMap() && !isOsmAndInstalled()) {
|
if (settings.hasAnyChatToShowOnMap() && !isOsmAndInstalled()) {
|
||||||
showOsmandMissingDialog()
|
showOsmandMissingDialog()
|
||||||
|
@ -189,7 +187,14 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene
|
||||||
telegramHelper.init()
|
telegramHelper.init()
|
||||||
telegramHelper.requestAuthorizationState()
|
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
|
else -> Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue