From 2de9be33fc3f045531fa83c7446be1024c77ee79 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 30 Apr 2024 06:55:05 +0000 Subject: [PATCH] fix: showing notification on page transitions There is a bug that after some page transitions notifications did not appear, but they appeared later in bulk when page was changed to some other. This change seems to fix it, though I don't fully understand if it is a correct fix. Signed-off-by: Petr Vobornik --- src/App.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index fd84536..71d53fd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,10 +14,10 @@ const App = () => { const navigate = useNavigate(); const { on } = useChrome(); - useEffect(() => { - const registry = getRegistry(); - registry.register({ notifications: notificationsReducer as Reducer }); + const registry = getRegistry(); + registry.register({ notifications: notificationsReducer as Reducer }); + useEffect(() => { const unregister = on('APP_NAVIGATION', (event) => navigate(`/${event.navId}`)); return () => { unregister?.();