Remove debug info (#1151)

This commit is contained in:
Alexander Zinchuk 2021-06-12 17:20:28 +03:00
parent 51b893d4df
commit 9967724a80

View File

@ -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.