diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/confirmaccountprovider/ConfirmAccountProviderView.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/confirmaccountprovider/ConfirmAccountProviderView.kt index c6d47793af..407ea9d88b 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/confirmaccountprovider/ConfirmAccountProviderView.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/confirmaccountprovider/ConfirmAccountProviderView.kt @@ -118,7 +118,8 @@ fun ConfirmAccountProviderView( }, onDismiss = { eventSink(ConfirmAccountProviderEvents.ClearError) - }) + } + ) } is AccountCreationNotSupported -> { ErrorDialog( diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/web/WebClientUrlForAuthenticationRetriever.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/web/WebClientUrlForAuthenticationRetriever.kt index 0f5375bde4..b7a30ee843 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/web/WebClientUrlForAuthenticationRetriever.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/web/WebClientUrlForAuthenticationRetriever.kt @@ -14,8 +14,8 @@ import io.element.android.features.login.impl.resolver.network.WellknownAPI import io.element.android.features.login.impl.screens.createaccount.AccountCreationNotSupported import io.element.android.libraries.di.AppScope import io.element.android.libraries.network.RetrofitFactory -import java.net.HttpURLConnection import timber.log.Timber +import java.net.HttpURLConnection import javax.inject.Inject interface WebClientUrlForAuthenticationRetriever { @@ -35,10 +35,9 @@ class DefaultWebClientUrlForAuthenticationRetriever @Inject constructor( .create(WellknownAPI::class.java) val result = try { wellknownApi.getElementWellKnown() - } catch (e: Exception) { + } catch (e: retrofit2.HttpException) { throw when { - e is retrofit2.HttpException && - e.code() == HttpURLConnection.HTTP_NOT_FOUND -> AccountCreationNotSupported() + e.code() == HttpURLConnection.HTTP_NOT_FOUND -> AccountCreationNotSupported() else -> e } } diff --git a/features/onboarding/impl/src/test/kotlin/io/element/android/features/onboarding/impl/OnBoardingPresenterTest.kt b/features/onboarding/impl/src/test/kotlin/io/element/android/features/onboarding/impl/OnBoardingPresenterTest.kt index fff5763221..8791992021 100644 --- a/features/onboarding/impl/src/test/kotlin/io/element/android/features/onboarding/impl/OnBoardingPresenterTest.kt +++ b/features/onboarding/impl/src/test/kotlin/io/element/android/features/onboarding/impl/OnBoardingPresenterTest.kt @@ -11,6 +11,7 @@ import app.cash.molecule.RecompositionMode import app.cash.molecule.moleculeFlow import app.cash.turbine.test import com.google.common.truth.Truth.assertThat +import io.element.android.appconfig.OnBoardingConfig import io.element.android.libraries.core.meta.BuildType import io.element.android.libraries.featureflag.api.FeatureFlags import io.element.android.libraries.featureflag.test.FakeFeatureFlagService @@ -46,7 +47,7 @@ class OnBoardingPresenterTest { assertThat(initialState.isDebugBuild).isTrue() assertThat(initialState.canLoginWithQrCode).isFalse() assertThat(initialState.productionApplicationName).isEqualTo("B") - assertThat(initialState.canCreateAccount).isFalse() + assertThat(initialState.canCreateAccount).isEqualTo(OnBoardingConfig.CAN_CREATE_ACCOUNT) assertThat(awaitItem().canLoginWithQrCode).isTrue() }