mirror of
https://github.com/booklore-app/booklore.git
synced 2026-02-18 00:17:53 +01:00
fix(reader): disable tap-to-turn-page on mobile devices
This commit is contained in:
@@ -451,11 +451,13 @@ export class ReaderEventService {
|
||||
const leftThreshold = width * this.LEFT_ZONE_PERCENT;
|
||||
const rightThreshold = width * this.RIGHT_ZONE_PERCENT;
|
||||
|
||||
if (x < leftThreshold) {
|
||||
const isMobile = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
||||
|
||||
if (x < leftThreshold && !isMobile) {
|
||||
this.isNavigating = true;
|
||||
this.viewCallbacks?.prev();
|
||||
setTimeout(() => this.isNavigating = false, 300);
|
||||
} else if (x > rightThreshold) {
|
||||
} else if (x > rightThreshold && !isMobile) {
|
||||
this.isNavigating = true;
|
||||
this.viewCallbacks?.next();
|
||||
setTimeout(() => this.isNavigating = false, 300);
|
||||
|
||||
Reference in New Issue
Block a user