From af983c76b8b0f2be21a39e13630af1bc666da7aa Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Thu, 28 Oct 2021 13:42:57 +0530 Subject: [PATCH] Fix SOO button sorting Signed-off-by: Ajay Bura --- src/app/molecules/sso-buttons/SSOButtons.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/molecules/sso-buttons/SSOButtons.jsx b/src/app/molecules/sso-buttons/SSOButtons.jsx index af6cb92..312a165 100644 --- a/src/app/molecules/sso-buttons/SSOButtons.jsx +++ b/src/app/molecules/sso-buttons/SSOButtons.jsx @@ -54,7 +54,10 @@ function SSOButtons({ homeserver }) {
{identityProviders // Sort by alphabetical order - .sort((idp, idp2) => !!idp.imageSrc && idp.name > idp2.name) + .sort((idp, idp2) => { + if (typeof idp.imageSrc !== 'string') return -1; + return idp.name.toLowerCase() > idp2.name.toLowerCase() ? 1 : -1; + }) .map((idp) => (