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