If signout request fails, do not start LoginActivity, but restart the app (#3099)
This commit is contained in:
parent
1ac17b3aee
commit
835eb95aa1
@ -24,6 +24,7 @@ Bugfix 🐛:
|
|||||||
- Disable URL preview for some domains (#2995)
|
- Disable URL preview for some domains (#2995)
|
||||||
- Fix avatar rendering for DMs, after initial sync (#2693)
|
- Fix avatar rendering for DMs, after initial sync (#2693)
|
||||||
- Fix mandatory parameter in API (#3065)
|
- Fix mandatory parameter in API (#3065)
|
||||||
|
- If signout request fails, do not start LoginActivity, but restart the app (#3099)
|
||||||
|
|
||||||
Translations 🗣:
|
Translations 🗣:
|
||||||
-
|
-
|
||||||
|
@ -212,15 +212,16 @@ class MainActivity : VectorBaseActivity<ActivityMainBinding>(), UnlockedActivity
|
|||||||
.setTitle(R.string.dialog_title_error)
|
.setTitle(R.string.dialog_title_error)
|
||||||
.setMessage(errorFormatter.toHumanReadable(failure))
|
.setMessage(errorFormatter.toHumanReadable(failure))
|
||||||
.setPositiveButton(R.string.global_retry) { _, _ -> doCleanUp() }
|
.setPositiveButton(R.string.global_retry) { _, _ -> doCleanUp() }
|
||||||
.setNegativeButton(R.string.cancel) { _, _ -> startNextActivityAndFinish() }
|
.setNegativeButton(R.string.cancel) { _, _ -> startNextActivityAndFinish(ignoreClearCredentials = true) }
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startNextActivityAndFinish() {
|
private fun startNextActivityAndFinish(ignoreClearCredentials: Boolean = false) {
|
||||||
val intent = when {
|
val intent = when {
|
||||||
args.clearCredentials
|
args.clearCredentials
|
||||||
|
&& !ignoreClearCredentials
|
||||||
&& (!args.isUserLoggedOut || args.isAccountDeactivated) ->
|
&& (!args.isUserLoggedOut || args.isAccountDeactivated) ->
|
||||||
// User has explicitly asked to log out or deactivated his account
|
// User has explicitly asked to log out or deactivated his account
|
||||||
LoginActivity.newIntent(this, null)
|
LoginActivity.newIntent(this, null)
|
||||||
|
Loading…
Reference in New Issue
Block a user