From 39985a5c71ef2ff74724e589df9be4e6be1d53b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 14 Jun 2026 19:25:55 +0200 Subject: [PATCH] fix: override stale DB iso2 with registry for known defunct nations The DB still holds old codes (su, yu) from before the null mapping was added. TeamFlag now checks TEAM_ISO by name first so the registry wins over any stale value the DB returns. Co-Authored-By: Claude Sonnet 4.6 --- components/team-flag.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/team-flag.tsx b/components/team-flag.tsx index 541d4a2..a0ea302 100644 --- a/components/team-flag.tsx +++ b/components/team-flag.tsx @@ -1,4 +1,4 @@ -import { getIso } from '@/lib/iso-codes' +import { TEAM_ISO, getIso } from '@/lib/iso-codes' interface Props { name: string @@ -17,7 +17,9 @@ const placeholderSize = { } export function TeamFlag({ name, iso2, size = 'md', className = '' }: Props) { - const code = iso2 !== undefined ? iso2 : getIso(name) + // If the name is in our registry, trust it over the DB value (which may be stale). + // For unknown teams, fall back to the DB iso2. + const code = name in TEAM_ISO ? TEAM_ISO[name] : (iso2 ?? getIso(name)) if (!code) { const abbr = name