From 74ab55392541f2eecec2ba6806f1d0a6a1bdd747 Mon Sep 17 00:00:00 2001 From: jedarden Date: Thu, 30 Apr 2026 17:56:48 -0400 Subject: [PATCH] Prefer matches with a winner for home page featured battle Filter the match pool to those with winner_id set before selecting the featured replay, so a stalemate is never shown as the hero replay. Falls back to any completed match if no decided matches exist. Co-Authored-By: Claude Sonnet 4.6 --- web/src/pages/home.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/pages/home.ts b/web/src/pages/home.ts index c7a0541..15a2a0b 100644 --- a/web/src/pages/home.ts +++ b/web/src/pages/home.ts @@ -22,7 +22,11 @@ async function findFeaturedReplay( ); if (completed.length === 0) return { match: null, enriched: false }; - const sorted = [...completed].sort( + // Prefer matches with a winner (no stalemates on the home page) + const withWinner = completed.filter((m) => !!m.winner_id); + const pool = withWinner.length > 0 ? withWinner : completed; + + const sorted = [...pool].sort( (a, b) => new Date(b.completed_at!).getTime() - new Date(a.completed_at!).getTime(),