mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-22 16:46:28 +01:00
Maybe this logic work better
This commit is contained in:
parent
e0cf2e22fd
commit
8e341ff7ed
1 changed files with 4 additions and 3 deletions
|
@ -179,21 +179,22 @@ function Notifications({ columnMode }) {
|
|||
|
||||
const loadUpdates = useCallback(
|
||||
({ disableIdleCheck = false } = {}) => {
|
||||
if (uiState === 'loading') {
|
||||
return;
|
||||
}
|
||||
console.log('✨ Load updates', {
|
||||
autoRefresh: snapStates.settings.autoRefresh,
|
||||
scrollTop: scrollableRef.current?.scrollTop,
|
||||
inBackground: inBackground(),
|
||||
disableIdleCheck,
|
||||
notificationsShowNew: snapStates.notificationsShowNew,
|
||||
uiState,
|
||||
});
|
||||
if (
|
||||
snapStates.settings.autoRefresh &&
|
||||
scrollableRef.current?.scrollTop < 16 &&
|
||||
(disableIdleCheck || window.__IDLE__) &&
|
||||
!inBackground() &&
|
||||
snapStates.notificationsShowNew &&
|
||||
uiState !== 'loading'
|
||||
snapStates.notificationsShowNew
|
||||
) {
|
||||
setShowNew(false);
|
||||
loadNotifications(true);
|
||||
|
|
Loading…
Reference in a new issue