From aea01072fb0b18ff15775777000b9970310d49be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 14 Nov 2023 10:37:09 -0600 Subject: [PATCH] fix: fetch neighbors after redundancy check --- src/app/tools/ratings/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tools/ratings/page.tsx b/src/app/tools/ratings/page.tsx index df0f09055..e367c7a9e 100644 --- a/src/app/tools/ratings/page.tsx +++ b/src/app/tools/ratings/page.tsx @@ -256,9 +256,7 @@ export default function Page() { id: number, size: number, ): Promise { - const { neighbors } = await getRatingsNeighbors(region, id, size, true); const radius = Math.round(size / 2); - const targetPosition = Object.entries(players[region][season]).find( ([, player]) => id === player.id, )?.[0]; @@ -279,6 +277,8 @@ export default function Page() { if (!isMissing) return []; } + const { neighbors } = await getRatingsNeighbors(region, id, size, true); + usePlayersCache.setState( produce((draft: PlayersCache) => { neighbors.forEach((neighbor) => {