Fix issue after rebase

This commit is contained in:
Benoit Marty 2021-04-14 20:37:07 +02:00
parent d812ed72d0
commit f0433fd27d
1 changed files with 82 additions and 86 deletions

View File

@ -618,9 +618,8 @@ class LoginViewModel2 @AssistedInject constructor(
} catch (failure: Throwable) {
_viewEvents.post(LoginViewEvents2.Failure(failure))
null
}
} ?: return
if (data is LoginFlowResult.Success) {
val loginMode = when {
data.supportedLoginTypes.contains(LoginFlowTypes.SSO)
&& data.supportedLoginTypes.contains(LoginFlowTypes.PASSWORD) -> LoginMode.SsoAndPassword(data.ssoIdentityProviders)
@ -661,7 +660,6 @@ class LoginViewModel2 @AssistedInject constructor(
_viewEvents.post(LoginViewEvents2.OutdatedHomeserver)
}
}
}
private suspend fun retrieveProfileInfo(username: String) {
val safeLoginWizard = loginWizard
@ -744,9 +742,8 @@ class LoginViewModel2 @AssistedInject constructor(
_viewEvents.post(LoginViewEvents2.Failure(failure))
setState { copy(isLoading = false) }
null
}
} ?: return@launch
if (data is LoginFlowResult.Success) {
// Valid Homeserver, add it to the history.
// Note: we add what the user has input, data.homeServerUrl can be different
rememberHomeServer(homeServerConnectionConfig.homeServerUri.toString())
@ -814,7 +811,6 @@ class LoginViewModel2 @AssistedInject constructor(
}
}
}
}
fun getInitialHomeServerUrl(): String? {
return loginConfig?.homeServerUrl