From 33ca07ca82b271dacf30e16273e19a6fbb4edc85 Mon Sep 17 00:00:00 2001 From: Gauvain Date: Mon, 6 Jul 2026 23:48:49 +0200 Subject: [PATCH] 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. --- app/(auth)/tv-subtitle-modal.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/(auth)/tv-subtitle-modal.tsx b/app/(auth)/tv-subtitle-modal.tsx index ed5d24d9..b29fa644 100644 --- a/app/(auth)/tv-subtitle-modal.tsx +++ b/app/(auth)/tv-subtitle-modal.tsx @@ -13,6 +13,7 @@ import { ActivityIndicator, Animated, Easing, + InteractionManager, Pressable, ScrollView, StyleSheet, @@ -645,8 +646,14 @@ export default function TVSubtitleModal() { const handleTrackSelect = useCallback( (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(); + InteractionManager.runAfterInteractions(() => option.setTrack?.()); }, [handleClose], );