From 60531c66f200bdfab2032b06b29eabd533bacdef Mon Sep 17 00:00:00 2001 From: jedarden Date: Wed, 13 May 2026 18:26:19 -0400 Subject: [PATCH] Bug fix bf-2vkw: Fix replay viewer blank when navigating to /watch/replay/:id directly When navigating to /watch/replay/:id (e.g., from the "Closest Match" link in rivalries), params.url was undefined, causing the viewer to show "Enter a replay URL to load" message. Fixed by constructing the URL from params.id when params.url is not set, using the pattern /r2/replays/MATCHID.json.gz. Co-Authored-By: Claude Sonnet 4.6 --- web/src/pages/replay.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/pages/replay.ts b/web/src/pages/replay.ts index b7b332a..08cb5b7 100644 --- a/web/src/pages/replay.ts +++ b/web/src/pages/replay.ts @@ -45,7 +45,9 @@ export function renderReplayPage(params: Record): void { `; loadReplayViewer().then(({ ReplayViewer }) => { - initReplayViewerWithClass(ReplayViewer, params.url); + // If params.url is not set but params.id is, construct the URL from the match ID + const replayUrl = params.url || (params.id ? `/r2/replays/${params.id}.json.gz` : undefined); + initReplayViewerWithClass(ReplayViewer, replayUrl); }); }