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 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 19:25:55 +02:00
parent b942ae7c8f
commit 39985a5c71
+4 -2
View File
@@ -1,4 +1,4 @@
import { getIso } from '@/lib/iso-codes' import { TEAM_ISO, getIso } from '@/lib/iso-codes'
interface Props { interface Props {
name: string name: string
@@ -17,7 +17,9 @@ const placeholderSize = {
} }
export function TeamFlag({ name, iso2, size = 'md', className = '' }: Props) { 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) { if (!code) {
const abbr = name const abbr = name