Leaderboards now honor the proper gameprofile formatter.

This commit is contained in:
zkldi
2021-12-12 13:19:43 +00:00
parent e2b1602503
commit 5bae11652a
@@ -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<integer, PublicUserDocument>();
for (const u of stats.users) {
@@ -131,7 +134,13 @@ function LeaderboardsPageContent({
{userMap.get(s.userID)?.username}
</GentleLink>
</td>
<td>{(s.ratings[alg] ?? 0).toFixed(2)}</td>
<td>
{s.ratings[alg]
? gptConfig.profileRatingAlgFormatters[alg]
? gptConfig.profileRatingAlgFormatters[alg]!(s.ratings[alg]!)
: s.ratings[alg]!.toFixed(2)
: "No Data."}
</td>
{/* temp */}
<td>
{Object.entries(s.classes).length