diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-06-26 22:31:55 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-06-26 22:31:55 -0700 |
| commit | 900fca9e5dbf7a714acf9de061962895295aa8be (patch) | |
| tree | a9336573378be4b6cc2372ca14f43462a1f6de99 /src/components/Chart | |
| parent | 1a47e30a98bd9d4742197ec8df1b5633ca110c42 (diff) | |
seperate audio and MV stat charts
Diffstat (limited to 'src/components/Chart')
| -rw-r--r-- | src/components/Chart/index.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
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<GuessCount, number> & { 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, |
