mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 13:48:20 +01:00
[UI/Login] Fix back button not working on Login Chooser.
This commit is contained in:
parent
5a77c481a2
commit
45753583ee
@ -39,22 +39,22 @@ class LoginActivity : AppCompatActivity(), CoroutineScope {
|
||||
val loginStores = mutableListOf<LoginStore>()
|
||||
|
||||
override fun onBackPressed() {
|
||||
val destination = nav.currentDestination
|
||||
if (destination != null && destination.id == R.id.loginSyncErrorFragment) {
|
||||
val destination = nav.currentDestination ?: run {
|
||||
nav.navigateUp()
|
||||
return
|
||||
}
|
||||
if (destination != null && destination.id == R.id.loginProgressFragment) {
|
||||
if (destination.id == R.id.loginSyncErrorFragment)
|
||||
return
|
||||
}
|
||||
if (destination != null && destination.id == R.id.loginSyncFragment) {
|
||||
if (destination.id == R.id.loginProgressFragment)
|
||||
return
|
||||
}
|
||||
if (destination != null && destination.id == R.id.loginChooserFragment && !app.config.loginFinished) {
|
||||
if (destination.id == R.id.loginSyncFragment)
|
||||
return
|
||||
if (destination.id == R.id.loginChooserFragment) {
|
||||
setResult(Activity.RESULT_CANCELED)
|
||||
finish()
|
||||
return
|
||||
}
|
||||
if (destination != null && destination.id == R.id.loginSummaryFragment) {
|
||||
if (destination.id == R.id.loginSummaryFragment) {
|
||||
MaterialAlertDialogBuilder(this)
|
||||
.setTitle(R.string.are_you_sure)
|
||||
.setMessage(R.string.login_cancel_confirmation)
|
||||
|
Loading…
x
Reference in New Issue
Block a user