mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-22 01:05:34 +03:00
Test fix for uncloseable 'New notifications' bug
This commit is contained in:
parent
a1b0d6e3bd
commit
6d5b2ef9a6
1 changed files with 3 additions and 6 deletions
|
@ -130,6 +130,7 @@ function Notifications({ columnMode }) {
|
|||
}
|
||||
|
||||
const loadNotifications = (firstLoad) => {
|
||||
setShowNew(false);
|
||||
setUIState('loading');
|
||||
(async () => {
|
||||
try {
|
||||
|
@ -192,19 +193,14 @@ function Notifications({ columnMode }) {
|
|||
scrollTop: scrollableRef.current?.scrollTop,
|
||||
inBackground: inBackground(),
|
||||
disableIdleCheck,
|
||||
notificationsShowNew: snapStates.notificationsShowNew,
|
||||
});
|
||||
if (
|
||||
snapStates.settings.autoRefresh &&
|
||||
scrollableRef.current?.scrollTop < 16 &&
|
||||
(disableIdleCheck || window.__IDLE__) &&
|
||||
!inBackground() &&
|
||||
snapStates.notificationsShowNew
|
||||
!inBackground()
|
||||
) {
|
||||
setShowNew(false);
|
||||
loadNotifications(true);
|
||||
} else {
|
||||
setShowNew(snapStates.notificationsShowNew);
|
||||
}
|
||||
},
|
||||
[snapStates.notificationsShowNew, snapStates.settings.autoRefresh, uiState],
|
||||
|
@ -228,6 +224,7 @@ function Notifications({ columnMode }) {
|
|||
if (v) {
|
||||
loadUpdates();
|
||||
}
|
||||
setShowNew(v);
|
||||
});
|
||||
}
|
||||
return () => {
|
||||
|
|
Loading…
Reference in a new issue