From 77870ab1a146bbcb5d2be9dbfe867af28ab58340 Mon Sep 17 00:00:00 2001 From: mattyl006 Date: Tue, 15 Nov 2022 17:34:27 +0100 Subject: [PATCH] correct sort submitters by adding lowercase --- .env | 2 +- src/components/sections/Leaderboard/Leaderboard.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 2488d38..1009950 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ REACT_APP_KC_URL=https://auth-dev.csi.wmi.amu.edu.pl/ REACT_APP_KC_REALM=gonito-dev -REACT_APP_KC_CLIENT_ID=gonito-dev-heroku +REACT_APP_KC_CLIENT_ID=gonito-dev-localhost diff --git a/src/components/sections/Leaderboard/Leaderboard.js b/src/components/sections/Leaderboard/Leaderboard.js index 944478a..67d610d 100644 --- a/src/components/sections/Leaderboard/Leaderboard.js +++ b/src/components/sections/Leaderboard/Leaderboard.js @@ -90,10 +90,10 @@ const Leaderboard = (props) => { switch (elem) { case 'submitter': 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); } 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); } break;