mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-07 13:02:52 +01:00
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:
@@ -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],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user