From ab03ebf9def78c6e183ab46c98969c3346789a08 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Feb 2026 05:17:32 +0000 Subject: [PATCH] Fix flex pick count using unique sports drafted, not total season sports The flex count was calculated as `totalPicks - totalSportsInSeason`, which always returned 0 when a team drafted multiple participants from the same sport (e.g. 2 picks from UEFA Champions League with 2 sports in season = 2 - 2 = 0). Now uses the number of unique sports the team has actually drafted from, so 2 picks in 1 sport correctly shows 1 flex used. https://claude.ai/code/session_01DZ6jqgZTDEmJucanBtRCtM --- app/components/draft/TeamsDraftedGrid.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/draft/TeamsDraftedGrid.tsx b/app/components/draft/TeamsDraftedGrid.tsx index 3781403..d9636d8 100644 --- a/app/components/draft/TeamsDraftedGrid.tsx +++ b/app/components/draft/TeamsDraftedGrid.tsx @@ -85,12 +85,13 @@ export function TeamsDraftedGrid({ draftSlots.forEach((slot) => { const teamPicks = picks.filter((p) => p.team.id === slot.team.id); - const flexUsed = Math.max(0, teamPicks.length - sports.length); + const uniqueSportsPicked = new Set(teamPicks.map((p) => p.sport.id)).size; + const flexUsed = Math.max(0, teamPicks.length - uniqueSportsPicked); map.set(slot.team.id, flexUsed); }); return map; - }, [picks, draftSlots, sports]); + }, [picks, draftSlots]); if (sports.length === 0) { return (