mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-21 22:36:36 +01:00
fix(tvOS): Patches for udp and screens menu button handling (#1564)
This commit is contained in:
@@ -28,6 +28,19 @@ export function disableTVMenuKeyInterception() {
|
||||
}
|
||||
}
|
||||
|
||||
export function useTVMenuKeyInterception(enabled = true) {
|
||||
useEffect(() => {
|
||||
if (!Platform.isTV) return;
|
||||
|
||||
if (enabled) {
|
||||
enableTVMenuKeyInterception();
|
||||
return;
|
||||
}
|
||||
|
||||
disableTVMenuKeyInterception();
|
||||
}, [enabled]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to TV back presses through React Native's BackHandler.
|
||||
*
|
||||
@@ -52,6 +65,8 @@ export function useTVBackPress(
|
||||
handler,
|
||||
);
|
||||
|
||||
return () => subscription.remove();
|
||||
return () => {
|
||||
subscription.remove();
|
||||
};
|
||||
}, deps);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user