Test fix notification toast appearing after loaded

This commit is contained in:
Lim Chee Aun 2024-05-28 13:44:02 +08:00
parent bd8817e61b
commit ed712d15f1

View file

@ -292,8 +292,13 @@ function Notifications({ columnMode }) {
}
}
});
const firstLoad = useRef(true);
useEffect(() => {
let unsub = subscribeKey(states, 'notificationsShowNew', (v) => {
if (firstLoad.current) {
firstLoad.current = false;
return;
}
if (uiState === 'loading') return;
if (v) loadUpdates();
setShowNew(v);