From: Ajay Bura Date: Thu, 28 Oct 2021 08:12:57 +0000 (+0530) Subject: Fix SOO button sorting X-Git-Tag: v1.5.0~19 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=af983c76b8b0f2be21a39e13630af1bc666da7aa;p=cinny.git Fix SOO button sorting Signed-off-by: Ajay Bura --- 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) => (