Remove isHovering

This commit is contained in:
Lim Chee Aun 2023-09-23 19:51:53 +08:00
parent e3b0c31798
commit 4c3666df6a
2 changed files with 1 additions and 18 deletions

View file

@ -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;
}}
>
<div class="timeline-deck deck">
<header

View file

@ -162,14 +162,12 @@ function Notifications({ columnMode }) {
}
}, [nearReachEnd, showMore]);
const isHovering = useRef(false);
const idle = useIdle(5000);
console.debug('🧘‍♀️ IDLE', idle);
const loadUpdates = useCallback(() => {
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;
}}
>
<div class={`timeline-deck deck ${onlyMentions ? 'only-mentions' : ''}`}>
<header