From 533c5066c197ac667c241808e9a2d8e22c85ed75 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 22 Aug 2022 23:51:15 -0700 Subject: [PATCH] remove old scroll engine for notifs --- packages/client/src/pages/notifications.vue | 52 --------------------- 1 file changed, 52 deletions(-) diff --git a/packages/client/src/pages/notifications.vue b/packages/client/src/pages/notifications.vue index ea5e8228fb..ae8025e227 100644 --- a/packages/client/src/pages/notifications.vue +++ b/packages/client/src/pages/notifications.vue @@ -103,56 +103,4 @@ definePageMetadata(computed(() => ({ title: i18n.ts.notifications, icon: 'fas fa-bell', }))); - -if (isMobile.value) { - document.addEventListener('touchstart', handleTouchStart, false); - document.addEventListener('touchmove', handleTouchMove, false); - - let xDown = null; - let yDown = null; - - function getTouches(evt) { - return ( - evt.touches || evt.originalEvent.touches - ); - } - - function handleTouchStart(evt) { - const firstTouch = getTouches(evt)[0]; - xDown = firstTouch.clientX; - yDown = firstTouch.clientY; - } - - function handleTouchMove(evt) { - if (!xDown || !yDown) { - return; - } - - let xUp = evt.touches[0].clientX; - let yUp = evt.touches[0].clientY; - - let xDiff = xDown - xUp; - let yDiff = yDown - yUp; - - let next = 'home'; - let tabs = ['all', 'unread', 'mentions', 'directNotes']; - - if (Math.abs(xDiff) > Math.abs(yDiff)) { - if (xDiff < 0) { - if (tab === 'all') { - next = 'directNotes'; - } - else { - next = tabs[(tabs.indexOf(tab) - 1) % tabs.length]; - } - } else { - next = tabs[(tabs.indexOf(tab) + 1) % tabs.length]; - } - tab = next; - } - xDown = null; - yDown = null; - return; - } -}