Use softLogoutCredentials in AuthenticationService, fix blank screen before soft logout

This commit is contained in:
ismailgulek
2022-06-09 14:21:13 +03:00
parent e2927ac206
commit f44f9ae1da
6 changed files with 55 additions and 49 deletions
@@ -118,16 +118,7 @@ class AuthenticationService: NSObject {
}
/// Credentials to be used when authenticating after soft logout, otherwise `nil`.
var softLogoutCredentials: MXCredentials? {
guard MXKAccountManager.shared().activeAccounts.isEmpty else { return nil }
for account in MXKAccountManager.shared().accounts {
if account.isSoftLogout {
return account.mxCredentials
}
}
return nil
}
var softLogoutCredentials: MXCredentials?
/// Get the last authenticated [Session], if there is an active session.
/// - Returns: The last active session if any, or `nil`
@@ -179,6 +170,7 @@ class AuthenticationService: NSObject {
func reset() {
loginWizard = nil
registrationWizard = nil
softLogoutCredentials = nil
// The previously used homeserver is re-used as `startFlow` will be called again a replace it anyway.
let address = state.homeserver.addressFromUser ?? state.homeserver.address