diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts index 9ada593a0..96a14784d 100644 --- a/app/src/mobile/index.ts +++ b/app/src/mobile/index.ts @@ -65,12 +65,8 @@ class App { if (navigator.userAgent.indexOf("iPhone") > -1) { document.addEventListener("touchstart", handleTouchStart, false); document.addEventListener("touchmove", handleTouchMove, false); - document.addEventListener("touchend", handleTouchEnd, false); - } else { - document.addEventListener("touchend", () => { - window.siyuan.mobileEditor?.protyle.breadcrumb.show(); - }, false); } + document.addEventListener("touchend", handleTouchEnd, false); }); setNoteBook(); promiseTransactions(); diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts index e3733e8fb..6c0fcd487 100644 --- a/app/src/mobile/util/touch.ts +++ b/app/src/mobile/util/touch.ts @@ -9,8 +9,13 @@ const forwardStack: IBackStack[] = []; let previousIsBack = false; export const handleTouchEnd = () => { - window.siyuan.mobileEditor?.protyle.breadcrumb.show(); - if (!clientX || !clientY) return; + if (window.siyuan.mobileEditor) { + window.siyuan.mobileEditor.protyle.breadcrumb.show(); + } + + if (!clientX || !clientY || navigator.userAgent.indexOf("iPhone") === -1) { + return; + } if (Math.abs(xDiff) > Math.abs(yDiff) && Math.abs(xDiff) > window.innerWidth / 2) { if (xDiff > 0) {