Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: programmatically navigating did not affect the menu

thecodrr457690d84073
diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js
index 620d69745..af5d587a9 100644
--- a/apps/web/src/components/navigation-menu/index.js
+++ b/apps/web/src/components/navigation-menu/index.js
@@ -1,4 +1,4 @@
-import React from "react";
+import React, { useEffect } from "react";
import ReactDOM from "react-dom";
import { Flex } from "rebass";
import RootNavigator, {
@@ -24,6 +24,13 @@ function NavigationMenu(props) {
const isSideMenuOpen = useStore((store) => store.isSideMenuOpen);
const toggleSideMenu = useStore((store) => store.toggleSideMenu);
+ useEffect(() => {
+ RootNavigator.onNavigate = (route) => {
+ setSelectedRoute(route.key);
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
return (
<Animated.Flex
flexDirection="column"