Test fix for uncloseable 'New notifications' bug

This commit is contained in:
Lim Chee Aun 2023-11-07 07:58:32 +08:00
parent a1b0d6e3bd
commit 6d5b2ef9a6

View file

@ -130,6 +130,7 @@ function Notifications({ columnMode }) {
} }
const loadNotifications = (firstLoad) => { const loadNotifications = (firstLoad) => {
setShowNew(false);
setUIState('loading'); setUIState('loading');
(async () => { (async () => {
try { try {
@ -192,19 +193,14 @@ function Notifications({ columnMode }) {
scrollTop: scrollableRef.current?.scrollTop, scrollTop: scrollableRef.current?.scrollTop,
inBackground: inBackground(), inBackground: inBackground(),
disableIdleCheck, disableIdleCheck,
notificationsShowNew: snapStates.notificationsShowNew,
}); });
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
) { ) {
setShowNew(false);
loadNotifications(true); loadNotifications(true);
} else {
setShowNew(snapStates.notificationsShowNew);
} }
}, },
[snapStates.notificationsShowNew, snapStates.settings.autoRefresh, uiState], [snapStates.notificationsShowNew, snapStates.settings.autoRefresh, uiState],
@ -228,6 +224,7 @@ function Notifications({ columnMode }) {
if (v) { if (v) {
loadUpdates(); loadUpdates();
} }
setShowNew(v);
}); });
} }
return () => { return () => {