From 59ee072b1501608431174f0cf93592c4bc5668a5 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 23 Oct 2025 11:33:43 -0700 Subject: refactor: clean up generic score display --- frontend/src/components/displays/GenericScoreDisplay.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'frontend/src/components') diff --git a/frontend/src/components/displays/GenericScoreDisplay.tsx b/frontend/src/components/displays/GenericScoreDisplay.tsx index 84fe492..6132a19 100644 --- a/frontend/src/components/displays/GenericScoreDisplay.tsx +++ b/frontend/src/components/displays/GenericScoreDisplay.tsx @@ -76,9 +76,7 @@ const ScoreDisplay: React.FC = ({ "grade", ]; const expandableKeys = ["judgements", "optional"]; - const skipKeys = ["user", "username"] - // get ?game= - const internalGameName =new URLSearchParams(window.location.search).get("game") || "dancerush"; + const gameParam = new URLSearchParams(window.location.search).get("game") || "generic"; // eslint-disable-next-line @typescript-eslint/no-explicit-any const formatValue = (value: any, key: string): string => { if (value === null || value === undefined) return "N/A"; @@ -269,11 +267,9 @@ const ScoreDisplay: React.FC = ({ return (
{sortedScores.map((score, index) => { - const chartIdHash = SHA1(`${internalGameName}${score.title}${score.artist}`).toString(); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { mainStats, expandable, others: rawOthers, timestamp } = + const chartIdHash = SHA1(`${gameParam}${score.title}${score.artist}`).toString(); + const { mainStats, expandable, others, timestamp } = getScoreEntries(score); - const others = rawOthers.filter(([key]) => !skipKeys.includes(key)); return ( @@ -285,7 +281,7 @@ const ScoreDisplay: React.FC = ({
{!hideTitleArtist && ( - +

{score.title || score.song || "Unknown Title"}

-- cgit v1.2.3