Skip to content

Commit

Permalink
fix: showing notification on page transitions
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pvoborni committed May 2, 2024
1 parent 37faf17 commit 2de9be3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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?.();
Expand Down

0 comments on commit 2de9be3

Please sign in to comment.