From 173703664d1c7ad00abe18a12747a476ea2d5876 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 21 Oct 2024 13:29:23 +0100 Subject: [PATCH] oops --- .../src/components/leaderboard/leaderboard-pp-chart.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/website/src/components/leaderboard/leaderboard-pp-chart.tsx b/projects/website/src/components/leaderboard/leaderboard-pp-chart.tsx index a48be22..c303947 100644 --- a/projects/website/src/components/leaderboard/leaderboard-pp-chart.tsx +++ b/projects/website/src/components/leaderboard/leaderboard-pp-chart.tsx @@ -17,14 +17,15 @@ type Props = { export default function LeaderboardPpChart({ leaderboard }: Props) { const [values, setValues] = useState([60, 100]); - const debouncedMin = useDebounce(values[0], 100); + const debouncedValues = useDebounce(values, 100); const histories: Record = {}; const labels: string[] = []; - const min = debouncedMin; - const precision = min >= 60 ? 0.1 : 0.2; - for (let accuracy = min; accuracy <= 100; accuracy += precision) { + const min = debouncedValues[0]; + const max = debouncedValues[1]; + const precision = min >= 60 ? 0.1 : 0.2; + for (let accuracy = min; accuracy <= max; accuracy += precision) { const label = accuracy.toFixed(2) + "%"; labels.push(label);