From 900fca9e5dbf7a714acf9de061962895295aa8be Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 26 Jun 2026 22:31:55 -0700 Subject: seperate audio and MV stat charts --- src/components/Chart/index.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/components/Chart/index.tsx') diff --git a/src/components/Chart/index.tsx b/src/components/Chart/index.tsx index 6aac91e..16336c8 100644 --- a/src/components/Chart/index.tsx +++ b/src/components/Chart/index.tsx @@ -21,6 +21,7 @@ interface Props { currentTry: number; didGuess: boolean; sessionDate: string; + mode?: "daily" | "dailyMV"; } interface HistoricalPlayData { @@ -32,9 +33,11 @@ interface HistoricalPlayData { type GuessCount = 1 | 2 | 3 | 4 | 5 | 6; type Distribution = Record & { NS: number }; -function getHistoricalPlayData(): HistoricalPlayData { +function getHistoricalPlayData(mode: "daily" | "dailyMV"): HistoricalPlayData { + const storageKey = + mode === "dailyMV" ? "historicalPlayDataMV" : "historicalPlayData"; try { - return JSON.parse(localStorage.getItem("historicalPlayData") || "{}"); + return JSON.parse(localStorage.getItem(storageKey) || "{}"); } catch { return {}; } @@ -59,8 +62,9 @@ export default function GuessDistributionChart({ currentTry, didGuess, sessionDate, + mode = "daily", }: Props) { - const historicalPlayData = getHistoricalPlayData(); + const historicalPlayData = getHistoricalPlayData(mode); const distribution: Distribution = { 1: 0, -- cgit v1.2.3