From 7adbb5d299a72f498a8d547be9c2687f1af9c19d Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 18 Feb 2024 01:07:51 +0100 Subject: [PATCH] Fix double press to skip 10s on web --- front/packages/ui/src/player/components/hover.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/packages/ui/src/player/components/hover.tsx b/front/packages/ui/src/player/components/hover.tsx index ed1bcd06..f6c9cdb7 100644 --- a/front/packages/ui/src/player/components/hover.tsx +++ b/front/packages/ui/src/player/components/hover.tsx @@ -265,7 +265,7 @@ export const HoverTouch = ({ children, ...props }: { children: ReactNode }) => { const onAnyPress = (e: { pointerType: string; x: number }) => { touch.current.count++; - if (touch.current.count >= 2) { + if (touch.current.count == 2) { onDoublePress(e); clearTimeout(touch.current.timeout); } else { @@ -286,7 +286,7 @@ export const HoverTouch = ({ children, ...props }: { children: ReactNode }) => { }} onPress={(e) => { e.preventDefault(); - onAnyPress({ pointerType: isTouch ? "touch" : "mouse", x: e.nativeEvent.locationX }); + onAnyPress({ pointerType: isTouch ? "touch" : "mouse", x: e.nativeEvent.locationX ?? e.nativeEvent.pageX }); }} onLayout={(e) => { playerWidth.current = e.nativeEvent.layout.width;