Skip to content

fix(tv): don't auto-add ?ch= on load (only after the viewer tunes) - #279

Merged
sktbrd merged 1 commit into
mainfrom
fix/tv-no-auto-ch-param
Aug 20, 2026
Merged

fix(tv): don't auto-add ?ch= on load (only after the viewer tunes)#279
sktbrd merged 1 commit into
mainfrom
fix/tv-no-auto-ch-param

Conversation

@sktbrd

@sktbrd sktbrd commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Bug: landing on the homepage auto-redirected the URL to ?ch=<propNumber> (e.g. ?ch=110) without any interaction.

Cause: the channel→URL writeback useEffect fired for the initial auto-selected channel, not just on a real channel change.

Fix: gate the writeback behind a userHasTunedRef that flips only inside tuneTo (the sole user-driven setIndex path). Fresh load ⇒ clean URL; a ?ch= deep link still selects on load (read-once effect) and stays until the viewer changes channels. tsc + eslint clean.

The TV channel writeback effect ran for the initial auto-selected
channel, so a fresh visit to the homepage immediately rewrote the URL
to `?ch=<propNumber>`. Gate the writeback behind a ref that flips only
when the viewer actually tunes a channel. A clean load now keeps a
clean URL; a `?ch=` deep link still selects on load and is preserved.
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
gnars-shadcn Ignored Ignored Aug 20, 2026 2:56pm
hackertestdao Ignored Ignored Aug 20, 2026 2:56pm

@sktbrd
sktbrd merged commit 5b5cbf4 into main Aug 20, 2026
4 checks passed
@sktbrd
sktbrd deleted the fix/tv-no-auto-ch-param branch August 20, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant