From 2b9d5f07632354b4835c4a40cae5dd1092c50dfa Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 1 Aug 2022 10:20:35 +0800 Subject: [PATCH] =?UTF-8?q?:recycle:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/mobile/index.ts | 6 +----- app/src/mobile/util/touch.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 7 deletions(-) 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) {