mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -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 }) => {
|
const onAnyPress = (e: { pointerType: string; x: number }) => {
|
||||||
touch.current.count++;
|
touch.current.count++;
|
||||||
if (touch.current.count >= 2) {
|
if (touch.current.count == 2) {
|
||||||
onDoublePress(e);
|
onDoublePress(e);
|
||||||
clearTimeout(touch.current.timeout);
|
clearTimeout(touch.current.timeout);
|
||||||
} else {
|
} else {
|
||||||
@ -286,7 +286,7 @@ export const HoverTouch = ({ children, ...props }: { children: ReactNode }) => {
|
|||||||
}}
|
}}
|
||||||
onPress={(e) => {
|
onPress={(e) => {
|
||||||
e.preventDefault();
|
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) => {
|
onLayout={(e) => {
|
||||||
playerWidth.current = e.nativeEvent.layout.width;
|
playerWidth.current = e.nativeEvent.layout.width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user