From 864f78e8fa78b8eb0bb53956108bd784cf4eeef2 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Thu, 2 Sep 2021 16:42:53 +0200 Subject: [PATCH] ui: Sort ranking ... --- frontend/ui/src/stores/teams.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/ui/src/stores/teams.js b/frontend/ui/src/stores/teams.js index ba42ad92..aacca996 100644 --- a/frontend/ui/src/stores/teams.js +++ b/frontend/ui/src/stores/teams.js @@ -15,6 +15,7 @@ function createTeamsStore() { teams[tid].id = Number(tid); rank.push(teams[tid]); } + rank.sort((a, b) => (a.rank > b.rank ? 1 : (a.rank == b.rank ? 0 : -1))); update((t) => (Object.assign(t, {teams, teams_count, rank})));