mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 21:52:44 +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>()
|
val loginStores = mutableListOf<LoginStore>()
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
val destination = nav.currentDestination
|
val destination = nav.currentDestination ?: run {
|
||||||
if (destination != null && destination.id == R.id.loginSyncErrorFragment) {
|
nav.navigateUp()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (destination != null && destination.id == R.id.loginProgressFragment) {
|
if (destination.id == R.id.loginSyncErrorFragment)
|
||||||
return
|
return
|
||||||
}
|
if (destination.id == R.id.loginProgressFragment)
|
||||||
if (destination != null && destination.id == R.id.loginSyncFragment) {
|
|
||||||
return
|
return
|
||||||
}
|
if (destination.id == R.id.loginSyncFragment)
|
||||||
if (destination != null && destination.id == R.id.loginChooserFragment && !app.config.loginFinished) {
|
return
|
||||||
|
if (destination.id == R.id.loginChooserFragment) {
|
||||||
setResult(Activity.RESULT_CANCELED)
|
setResult(Activity.RESULT_CANCELED)
|
||||||
finish()
|
finish()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (destination != null && destination.id == R.id.loginSummaryFragment) {
|
if (destination.id == R.id.loginSummaryFragment) {
|
||||||
MaterialAlertDialogBuilder(this)
|
MaterialAlertDialogBuilder(this)
|
||||||
.setTitle(R.string.are_you_sure)
|
.setTitle(R.string.are_you_sure)
|
||||||
.setMessage(R.string.login_cancel_confirmation)
|
.setMessage(R.string.login_cancel_confirmation)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user