fix(tv): apply subtitle selection after the modal route is dismissed

The TV subtitle modal is a separate route; running the selection callback before
router.back() meant a navigating selection (replacePlayer for a burned-in switch
while transcoding) targeted the modal route and was swallowed. Close first, then
run the callback via InteractionManager.runAfterInteractions.
This commit is contained in:
Gauvain
2026-07-06 23:48:49 +02:00
parent e5d56d6ad1
commit 33ca07ca82

View File

@@ -13,6 +13,7 @@ import {
ActivityIndicator, ActivityIndicator,
Animated, Animated,
Easing, Easing,
InteractionManager,
Pressable, Pressable,
ScrollView, ScrollView,
StyleSheet, StyleSheet,
@@ -645,8 +646,14 @@ export default function TVSubtitleModal() {
const handleTrackSelect = useCallback( const handleTrackSelect = useCallback(
(option: { setTrack?: () => void }) => { (option: { setTrack?: () => void }) => {
option.setTrack?.(); // Close FIRST, apply after the modal route is dismissed: setTrack can
// trigger replacePlayer (burn-in switches while transcoding), and a
// router.replace fired while this modal is the active route targets the
// MODAL instead of the player screen — the navigation is swallowed and
// the selection silently no-ops (same trap as the setParams note in
// Controls.tv's handleOpenSubtitleSheet).
handleClose(); handleClose();
InteractionManager.runAfterInteractions(() => option.setTrack?.());
}, },
[handleClose], [handleClose],
); );