correct sort submitters by adding lowercase

This commit is contained in:
mattyl006 2022-11-15 17:34:27 +01:00
parent 782627a920
commit 77870ab1a1
2 changed files with 3 additions and 3 deletions

2
.env
View File

@ -1,3 +1,3 @@
REACT_APP_KC_URL=https://auth-dev.csi.wmi.amu.edu.pl/ REACT_APP_KC_URL=https://auth-dev.csi.wmi.amu.edu.pl/
REACT_APP_KC_REALM=gonito-dev REACT_APP_KC_REALM=gonito-dev
REACT_APP_KC_CLIENT_ID=gonito-dev-heroku REACT_APP_KC_CLIENT_ID=gonito-dev-localhost

View File

@ -90,10 +90,10 @@ const Leaderboard = (props) => {
switch (elem) { switch (elem) {
case 'submitter': case 'submitter':
if (submitterSorted) { if (submitterSorted) {
newEntries = newEntries.sort((a, b) => (a.submitter < b.submitter) ? 1 : ((b.submitter < a.submitter) ? -1 : 0)); newEntries = newEntries.sort((a, b) => (a.submitter.toLowerCase() < b.submitter.toLowerCase()) ? 1 : ((b.submitter.toLowerCase() < a.submitter.toLowerCase()) ? -1 : 0));
setSubmitterSorted(false); setSubmitterSorted(false);
} else { } else {
newEntries = newEntries.sort((a, b) => (a.submitter > b.submitter) ? 1 : ((b.submitter > a.submitter) ? -1 : 0)); newEntries = newEntries.sort((a, b) => (a.submitter.toLowerCase() > b.submitter.toLowerCase()) ? 1 : ((b.submitter.toLowerCase() > a.submitter.toLowerCase()) ? -1 : 0));
setSubmitterSorted(true); setSubmitterSorted(true);
} }
break; break;