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);