fix: show 0-0 for live matches with no score data; exclude live from recent

MatchCard: display '0–0' instead of '?–?' when a match is live but
score_ft_home is still NULL (sync hasn't picked up the score yet, or
Wikipedia hasn't been updated — every match starts at 0-0).

recentMatches resolver: fetch limit*2 rows then filter out live matches
so a match with score_ft_home=0 that is still in progress doesn't appear
in both the live section and recent results simultaneously.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 20:00:07 +02:00
parent 71e7e47aca
commit 2bd32daae1
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ export function MatchCard({ match, compact = false }: { match: Match; compact?:
: match.scoreEt : match.scoreEt
? `${match.scoreEt[0]} ${match.scoreEt[1]}` ? `${match.scoreEt[0]} ${match.scoreEt[1]}`
: `${ft![0]} ${ft![1]}` : `${ft![0]} ${ft![1]}`
: match.isLive ? <LiveBadge label="•" /> : ''} : match.isLive ? '0 0' : ''}
</div> </div>
{match.scoreP && ( {match.scoreP && (
<div className="text-[8px] text-green-muted leading-none"> <div className="text-[8px] text-green-muted leading-none">
@@ -98,7 +98,7 @@ export function MatchCard({ match, compact = false }: { match: Match; compact?:
: match.scoreEt : match.scoreEt
? `${match.scoreEt[0]}${match.scoreEt[1]}` ? `${match.scoreEt[0]}${match.scoreEt[1]}`
: `${ft![0]}${ft![1]}` : `${ft![0]}${ft![1]}`
: '??'} : match.isLive ? '00' : '??'}
</div> </div>
{match.scoreP && ( {match.scoreP && (
<div className="text-[10px] text-green-muted mt-0.5">{ft![0]}{ft![1]} a.e.t.</div> <div className="text-[10px] text-green-muted mt-0.5">{ft![0]}{ft![1]} a.e.t.</div>
+3 -2
View File
@@ -121,8 +121,9 @@ export const resolvers = {
eq(matches.isQualiPlayoff, false), eq(matches.isQualiPlayoff, false),
)) ))
.orderBy(desc(matches.date), desc(matches.id)) .orderBy(desc(matches.date), desc(matches.id))
.limit(limit) .limit(limit * 2)
return Promise.all(rows.map(hydrateMatch)) const hydrated = await Promise.all(rows.map(hydrateMatch))
return hydrated.filter(m => !m.isLive).slice(0, limit)
} catch (e) { if (isMissingTable(e)) return []; throw e } } catch (e) { if (isMissingTable(e)) return []; throw e }
}, },
async upcomingMatches(_: unknown, { limit = 10 }: { limit?: number }) { async upcomingMatches(_: unknown, { limit = 10 }: { limit?: number }) {