Fix SOO button sorting

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-10-28 13:42:57 +05:30
parent ef161bbb31
commit af983c76b8

View file

@ -54,7 +54,10 @@ function SSOButtons({ homeserver }) {
<div className="sso-buttons__container">
{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) => (
<SSOButton
key={idp.id}