From ed712d15f1815741f9a70520cf7b790f69032122 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 28 May 2024 13:44:02 +0800 Subject: [PATCH] Test fix notification toast appearing after loaded --- src/pages/notifications.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx index 9843411a..4e03cd57 100644 --- a/src/pages/notifications.jsx +++ b/src/pages/notifications.jsx @@ -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);