Merge the 2 map.

This commit is contained in:
Benoit Marty 2023-06-09 17:55:09 +02:00
parent ee38aee147
commit f311641ab3

View file

@ -85,12 +85,11 @@ class ConfirmAccountProviderPresenter @AssistedInject constructor(
suspend {
val domain = tryOrNull { URL(homeserverUrl) }?.host ?: homeserverUrl
authenticationService.setHomeserver(domain).map {
authenticationService.getHomeserverDetails().value!!
}.map {
if (it.supportsOidcLogin) {
val matrixHomeServerDetails = authenticationService.getHomeserverDetails().value!!
if (matrixHomeServerDetails.supportsOidcLogin) {
// Retrieve the details right now
LoginFlow.OidcFlow(authenticationService.getOidcUrl().getOrThrow())
} else if (it.supportsPasswordLogin) {
} else if (matrixHomeServerDetails.supportsPasswordLogin) {
LoginFlow.PasswordLogin
} else {
throw IllegalStateException("Unsupported login flow")