From 419231bddbf5bb083d2749568a17c0ab772df935 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Tue, 30 Jun 2026 04:14:14 +0200 Subject: [PATCH] fix(player): open the channel page from the player without it bouncing back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs made clicking the channel name in the video modal just close the player: - the second PlayerModal mount (main feed path) was missing onOpenChannel, so the handler hit its no-op early return; - opening the channel synchronously pushed the _chan history entry, which the player's own useBackToClose teardown (history.back on unmount) then immediately popped. Now the open is deferred to a one-shot popstate listener that fires AFTER that teardown, so the channel entry lands at the feed level. Verified: player → channel name → channel page; Back → feed (player does not reappear). --- frontend/src/components/Feed.tsx | 1 + frontend/src/components/PlayerModal.tsx | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Feed.tsx b/frontend/src/components/Feed.tsx index 4d097ee..f7fc781 100644 --- a/frontend/src/components/Feed.tsx +++ b/frontend/src/components/Feed.tsx @@ -587,6 +587,7 @@ export default function Feed({ startAt={activeVideo.startAt} onClose={() => setActiveVideo(null)} onState={onState} + onOpenChannel={onOpenChannel} /> )} {isFetchingNextPage && ( diff --git a/frontend/src/components/PlayerModal.tsx b/frontend/src/components/PlayerModal.tsx index 056dd42..973ada7 100644 --- a/frontend/src/components/PlayerModal.tsx +++ b/frontend/src/components/PlayerModal.tsx @@ -559,8 +559,19 @@ export default function PlayerModal({