compact code

This commit is contained in:
Benoit Marty 2021-04-14 12:48:33 +02:00
parent 89c2662e09
commit 877e0ca5c6
1 changed files with 3 additions and 7 deletions

View File

@ -102,15 +102,11 @@ class LoginFragment @Inject constructor() : AbstractSSOLoginFragment<FragmentLog
}
private fun setupSocialLoginButtons(state: LoginViewState) {
when (state.signMode) {
views.loginSocialLoginButtons.mode = when (state.signMode) {
SignMode.Unknown -> error("developer error")
SignMode.SignUp -> {
views.loginSocialLoginButtons.mode = SocialLoginButtonsView.Mode.MODE_SIGN_UP
}
SignMode.SignUp -> SocialLoginButtonsView.Mode.MODE_SIGN_UP
SignMode.SignIn,
SignMode.SignInWithMatrixId -> {
views.loginSocialLoginButtons.mode = SocialLoginButtonsView.Mode.MODE_SIGN_IN
}
SignMode.SignInWithMatrixId -> SocialLoginButtonsView.Mode.MODE_SIGN_IN
}.exhaustive
}