From 4c3666df6a8b6a2d2bcaac9fc906fc357a89d005 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 23 Sep 2023 19:51:53 +0800 Subject: [PATCH] Remove isHovering --- src/components/timeline.jsx | 7 ------- src/pages/notifications.jsx | 12 +----------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/components/timeline.jsx b/src/components/timeline.jsx index e112562c..13f00202 100644 --- a/src/components/timeline.jsx +++ b/src/components/timeline.jsx @@ -206,7 +206,6 @@ function Timeline({ } }, [nearReachEnd, showMore]); - const isHovering = useRef(false); const idle = useIdle(5000); console.debug('🧘‍♀️ IDLE', idle); const loadOrCheckUpdates = useCallback( @@ -275,12 +274,6 @@ function Timeline({ oRef.current = node; }} tabIndex="-1" - onPointerEnter={(e) => { - isHovering.current = true; - }} - onPointerLeave={() => { - isHovering.current = false; - }} >
{ console.log('✨ Load updates', { autoRefresh: snapStates.settings.autoRefresh, scrollTop: scrollableRef.current?.scrollTop === 0, - isHovering: isHovering.current, inBackground: inBackground(), notificationsShowNew: snapStates.notificationsShowNew, uiState, @@ -177,7 +175,7 @@ function Notifications({ columnMode }) { if ( snapStates.settings.autoRefresh && scrollableRef.current?.scrollTop === 0 && - (!isHovering.current || idle) && + idle && !inBackground() && snapStates.notificationsShowNew && uiState !== 'loading' @@ -236,14 +234,6 @@ function Notifications({ columnMode }) { class="deck-container" ref={scrollableRef} tabIndex="-1" - onPointerEnter={() => { - console.log('👆 Pointer enter'); - isHovering.current = true; - }} - onPointerLeave={() => { - console.log('👇 Pointer leave'); - isHovering.current = false; - }} >