mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix double press to skip 10s on web
This commit is contained in:
parent
2a3d5de54b
commit
7adbb5d299
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user