mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-07 13:02:52 +01:00
fix(tv): only defer subtitle selection when it navigates
The close-first + runAfterInteractions pattern is needed only in the player, where selecting a subtitle can navigate (replacePlayer for a burn-in switch while transcoding). On the item detail page the selection just updates state, so deferring it until after the modal is dismissed re-renders the page after focus returns and yanks TV focus — leaving navigation stuck. Gate the deferral behind deferApplyUntilDismissed (set by the in-player caller only); the detail page runs the selection before closing, preserving focus.
This commit is contained in:
@@ -601,6 +601,9 @@ export const Controls: FC<Props> = ({
|
||||
mediaSourceId: mediaSource?.Id,
|
||||
subtitleTracks: tracksWithoutDisable,
|
||||
currentSubtitleIndex: subtitleIndex ?? -1,
|
||||
// In-player selection can navigate (replacePlayer for burn-in switches);
|
||||
// apply it after the modal route is dismissed so it isn't swallowed.
|
||||
deferApplyUntilDismissed: true,
|
||||
onDisableSubtitles: () => {
|
||||
// Find and call the "Disable" track's setTrack from VideoContext
|
||||
const disableTrack = videoContextSubtitleTracks?.find(
|
||||
|
||||
Reference in New Issue
Block a user