From 2bd32daae1dddc2aff86044ada6572370a1cb73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 15 Jun 2026 20:00:07 +0200 Subject: [PATCH] fix: show 0-0 for live matches with no score data; exclude live from recent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- components/match-card.tsx | 4 ++-- lib/graphql/resolvers/index.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/match-card.tsx b/components/match-card.tsx index f4ae624..014b94c 100644 --- a/components/match-card.tsx +++ b/components/match-card.tsx @@ -51,7 +51,7 @@ export function MatchCard({ match, compact = false }: { match: Match; compact?: : match.scoreEt ? `${match.scoreEt[0]} – ${match.scoreEt[1]}` : `${ft![0]} – ${ft![1]}` - : match.isLive ? : '–'} + : match.isLive ? '0 – 0' : '–'} {match.scoreP && (
@@ -98,7 +98,7 @@ export function MatchCard({ match, compact = false }: { match: Match; compact?: : match.scoreEt ? `${match.scoreEt[0]}–${match.scoreEt[1]}` : `${ft![0]}–${ft![1]}` - : '?–?'} + : match.isLive ? '0–0' : '?–?'}
{match.scoreP && (
{ft![0]}–{ft![1]} a.e.t.
diff --git a/lib/graphql/resolvers/index.ts b/lib/graphql/resolvers/index.ts index 128b725..0dc5d0f 100644 --- a/lib/graphql/resolvers/index.ts +++ b/lib/graphql/resolvers/index.ts @@ -121,8 +121,9 @@ export const resolvers = { eq(matches.isQualiPlayoff, false), )) .orderBy(desc(matches.date), desc(matches.id)) - .limit(limit) - return Promise.all(rows.map(hydrateMatch)) + .limit(limit * 2) + 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 } }, async upcomingMatches(_: unknown, { limit = 10 }: { limit?: number }) {