Merge pull request #4379 from vector-im/feature/adm/sso-ordering

Sorting social providers by priority
This commit is contained in:
Benoit Marty 2021-11-02 09:53:32 +01:00 committed by GitHub
commit 26f8f5d1fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

1
changelog.d/4277.feature Normal file
View file

@ -0,0 +1 @@
Updating single sign on providers ordering to match priority/popularity

View file

@ -193,7 +193,7 @@ class LoginFragment @Inject constructor() : AbstractSSOLoginFragment<FragmentLog
if (state.loginMode is LoginMode.SsoAndPassword) {
views.loginSocialLoginContainer.isVisible = true
views.loginSocialLoginButtons.ssoIdentityProviders = state.loginMode.ssoIdentityProviders
views.loginSocialLoginButtons.ssoIdentityProviders = state.loginMode.ssoIdentityProviders?.sorted()
views.loginSocialLoginButtons.listener = object : SocialLoginButtonsView.InteractionListener {
override fun onProviderSelected(id: String?) {
loginViewModel.getSsoUrl(

View file

@ -72,7 +72,7 @@ class LoginSignUpSignInSelectionFragment @Inject constructor() : AbstractSSOLogi
when (state.loginMode) {
is LoginMode.SsoAndPassword -> {
views.loginSignupSigninSignInSocialLoginContainer.isVisible = true
views.loginSignupSigninSocialLoginButtons.ssoIdentityProviders = state.loginMode.ssoIdentityProviders()
views.loginSignupSigninSocialLoginButtons.ssoIdentityProviders = state.loginMode.ssoIdentityProviders()?.sorted()
views.loginSignupSigninSocialLoginButtons.listener = object : SocialLoginButtonsView.InteractionListener {
override fun onProviderSelected(id: String?) {
loginViewModel.getSsoUrl(