From 5bae11652a55a21e6c0f5cc4dbde7f58c3c756b0 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sun, 12 Dec 2021 13:19:43 +0000 Subject: [PATCH] Leaderboards now honor the proper gameprofile formatter. --- .../users/games/_game/_playtype/LeaderboardsPage.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/LeaderboardsPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/LeaderboardsPage.tsx index 137bf1109..e90fefd94 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/LeaderboardsPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/LeaderboardsPage.tsx @@ -12,6 +12,7 @@ import { COLOUR_SET, FormatGame, GetGameConfig, + GetGamePTConfig, IDStrings, integer, PublicUserDocument, @@ -92,6 +93,8 @@ function LeaderboardsPageContent({ } & GamePT) { const { stats, leaderboard } = data; + const gptConfig = GetGamePTConfig(game, playtype); + const userMap = new Map(); for (const u of stats.users) { @@ -131,7 +134,13 @@ function LeaderboardsPageContent({ {userMap.get(s.userID)?.username} - {(s.ratings[alg] ?? 0).toFixed(2)} + + {s.ratings[alg] + ? gptConfig.profileRatingAlgFormatters[alg] + ? gptConfig.profileRatingAlgFormatters[alg]!(s.ratings[alg]!) + : s.ratings[alg]!.toFixed(2) + : "No Data."} + {/* temp */} {Object.entries(s.classes).length