mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 10:45:41 +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) => {
|
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 () => {
|
||||||
|
|
Loading…
Reference in a new issue