diff --git a/web/pages/fold/[...slugs]/index.tsx b/web/pages/fold/[...slugs]/index.tsx index 5d4a07a6..d5f905a4 100644 --- a/web/pages/fold/[...slugs]/index.tsx +++ b/web/pages/fold/[...slugs]/index.tsx @@ -104,8 +104,14 @@ async function toUserScores(userScores: { [userId: string]: number }) { const topUsers = await Promise.all( topUserPairs.map(([userId]) => getUser(userId)) ) - const topUserScores = topUserPairs.map(([_, score]) => score) - return [topUsers, topUserScores] as const + const existingPairs = topUserPairs.filter(([id, _]) => + topUsers.find((user) => user?.id === id) + ) + const topExistingUsers = existingPairs.map( + ([id]) => topUsers.find((user) => user?.id === id) as User + ) + const topUserScores = existingPairs.map(([_, score]) => score) + return [topExistingUsers, topUserScores] as const } export async function getStaticPaths() {