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