diff --git a/src/hooks/useHistoryBack.ts b/src/hooks/useHistoryBack.ts index 7d3355d7e..520984a0a 100644 --- a/src/hooks/useHistoryBack.ts +++ b/src/hooks/useHistoryBack.ts @@ -8,16 +8,13 @@ type HistoryBackFunction = ((event: PopStateEvent, noAnimation: boolean, previou // Carefully selected by swiping and observing visual changes // TODO: may be different on other devices such as iPad, maybe take dpi into account? -const SAFARI_EDGE_BACK_GESTURE_LIMIT = 200; +const SAFARI_EDGE_BACK_GESTURE_LIMIT = 60; const SAFARI_EDGE_BACK_GESTURE_DURATION = 200; let isEdge = false; const onTouchStart = (event: TouchEvent) => { const x = event.touches[0].pageX; - // eslint-disable-next-line no-console - console.log('starting touch from', x); - if (x <= SAFARI_EDGE_BACK_GESTURE_LIMIT || x >= window.innerWidth - SAFARI_EDGE_BACK_GESTURE_LIMIT) { isEdge = true; } @@ -25,11 +22,7 @@ const onTouchStart = (event: TouchEvent) => { const onTouchEnd = () => { if (isEdge) { - // eslint-disable-next-line no-console - console.log('touchend'); setTimeout(() => { - // eslint-disable-next-line no-console - console.log('setting isEdge to false'); isEdge = false; }, SAFARI_EDGE_BACK_GESTURE_DURATION); } @@ -44,8 +37,6 @@ if (IS_IOS) { export default function useHistoryBack(handler: NoneToVoidFunction | HistoryBackFunction) { const onPopState = (event: PopStateEvent) => { - // eslint-disable-next-line no-console - console.log('onPopState, isEdge = ', isEdge, 'isHistoryChangedByUser = ', HistoryWrapper.isHistoryChangedByUser); // Check if the event was caused by History API call or the user if (!HistoryWrapper.isHistoryChangedByUser) { // HACK: Handle multiple event listeners.