mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
fix: double tap works indipendant of controls showing
This commit is contained in:
@@ -247,9 +247,8 @@ export const GestureOverlay = ({
|
||||
screenHeight,
|
||||
});
|
||||
|
||||
// If controls are visible, act like the old tap overlay
|
||||
if (showControls) {
|
||||
return (
|
||||
// Background overlay when controls are visible
|
||||
const controlsOverlay = showControls && (
|
||||
<Pressable
|
||||
onPress={onToggleControls}
|
||||
style={{
|
||||
@@ -265,11 +264,13 @@ export const GestureOverlay = ({
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Gesture detection area */}
|
||||
{/* Controls overlay when visible */}
|
||||
{controlsOverlay}
|
||||
|
||||
{/* Gesture detection area - always present */}
|
||||
<Pressable
|
||||
onTouchStart={handleTouchStart}
|
||||
onTouchMove={handleTouchMove}
|
||||
|
||||
@@ -4,8 +4,6 @@ import type { GestureResponderEvent } from "react-native";
|
||||
export interface SwipeGestureOptions {
|
||||
minDistance?: number;
|
||||
maxDuration?: number;
|
||||
onSwipeLeft?: () => void;
|
||||
onSwipeRight?: () => void;
|
||||
onDoubleTapLeft?: () => void;
|
||||
onDoubleTapRight?: () => void;
|
||||
onVerticalDragStart?: (side: "left" | "right", initialY: number) => void;
|
||||
@@ -23,8 +21,6 @@ export interface SwipeGestureOptions {
|
||||
export const useGestureDetection = ({
|
||||
minDistance = 50,
|
||||
maxDuration = 800,
|
||||
onSwipeLeft,
|
||||
onSwipeRight,
|
||||
onDoubleTapLeft,
|
||||
onDoubleTapRight,
|
||||
onVerticalDragStart,
|
||||
@@ -207,7 +203,7 @@ export const useGestureDetection = ({
|
||||
lastTapTime.current = 0;
|
||||
lastTapPosition.current = { x: 0, y: 0 };
|
||||
} else {
|
||||
// It's a single tap
|
||||
// It's a single tap - execute immediately
|
||||
onTap?.();
|
||||
lastTapTime.current = currentTime;
|
||||
lastTapPosition.current = { x: tapX, y: tapY };
|
||||
|
||||
Reference in New Issue
Block a user