Fix unset classes showing up as (messed up!) (#1642)

This commit is contained in:
beerpsi
2026-06-05 09:16:00 +01:00
committed by GitHub
parent 7537bc0b28
commit 20899edb54
2 changed files with 14 additions and 8 deletions
@@ -31,7 +31,7 @@ import { ClumpActivity, GetUsers } from "#util/activity";
import { APIFetchV1 } from "#util/api";
import { ONE_HOUR } from "#util/constants/time";
import { CreateScoreIDMap, CreateUserMap } from "#util/data";
import { NO_OP, TruncateString } from "#util/misc";
import { NO_OP, TruncateString, UppercaseFirst } from "#util/misc";
import { FormatTime, MillisToSince } from "#util/time";
import React, { useContext, useEffect, useState } from "react";
import { Button, Col, Row } from "react-bootstrap";
@@ -689,12 +689,18 @@ function ClassAchievementActivity({
<UGPTLink game={classGame} reqUser={user} />{" "}
{data.source === "manual" ? (
<>
manually set{" "}
<ClassBadge
classSet={data.classSet}
classValue={data.classValue}
game={classGame}
/>
{data.classValue ? (
<>
manually set{" "}
<ClassBadge
classSet={data.classSet}
classValue={data.classValue}
game={classGame}
/>
</>
) : (
`manually unset ${UppercaseFirst(data.classSet)}`
)}
{shouldShowGame && ` in ${FormatGame(classGame)}`}
{data.classOldValue !== null && (
<>
@@ -28,7 +28,7 @@ export default function UGPTRatingsTable({ ugs }: { ugs: UserGameStats }) {
<>
{(Object.keys(gameConfig.classes) as Classes[V3Game][])
.sort(StrSOV((x) => x[0]))
.filter((k) => ugs.classes[k] !== undefined)
.filter((k) => ugs.classes[k] !== undefined && ugs.classes[k] !== null)
.map((k) => (
<tr key={k}>
<td>{UppercaseFirst(k)}</td>