Fix issue after rebase

This commit is contained in:
Benoit Marty 2021-04-14 20:37:07 +02:00
parent d812ed72d0
commit f0433fd27d

View file

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