mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 00:56:23 +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(
|
const loadUpdates = useCallback(
|
||||||
({ disableIdleCheck = false } = {}) => {
|
({ disableIdleCheck = false } = {}) => {
|
||||||
|
if (uiState === 'loading') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log('✨ Load updates', {
|
console.log('✨ Load updates', {
|
||||||
autoRefresh: snapStates.settings.autoRefresh,
|
autoRefresh: snapStates.settings.autoRefresh,
|
||||||
scrollTop: scrollableRef.current?.scrollTop,
|
scrollTop: scrollableRef.current?.scrollTop,
|
||||||
inBackground: inBackground(),
|
inBackground: inBackground(),
|
||||||
disableIdleCheck,
|
disableIdleCheck,
|
||||||
notificationsShowNew: snapStates.notificationsShowNew,
|
notificationsShowNew: snapStates.notificationsShowNew,
|
||||||
uiState,
|
|
||||||
});
|
});
|
||||||
if (
|
if (
|
||||||
snapStates.settings.autoRefresh &&
|
snapStates.settings.autoRefresh &&
|
||||||
scrollableRef.current?.scrollTop < 16 &&
|
scrollableRef.current?.scrollTop < 16 &&
|
||||||
(disableIdleCheck || window.__IDLE__) &&
|
(disableIdleCheck || window.__IDLE__) &&
|
||||||
!inBackground() &&
|
!inBackground() &&
|
||||||
snapStates.notificationsShowNew &&
|
snapStates.notificationsShowNew
|
||||||
uiState !== 'loading'
|
|
||||||
) {
|
) {
|
||||||
setShowNew(false);
|
setShowNew(false);
|
||||||
loadNotifications(true);
|
loadNotifications(true);
|
||||||
|
|
Loading…
Reference in a new issue