A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: deselect items on navigate
thecodrr9b0f8dd419d5
diff --git a/apps/web/src/components/cached-router/index.js b/apps/web/src/components/cached-router/index.jsindex e81b43795..fcf5cd0ad 100644--- a/apps/web/src/components/cached-router/index.js+++ b/apps/web/src/components/cached-router/index.js@@ -1,6 +1,7 @@import React, { useEffect } from "react";import ReactDOM from "react-dom";import { getHomeRoute, NavigationEvents } from "../../navigation";+import { store as selectionStore } from "../../stores/selection-store";import useRoutes from "../../utils/use-routes";import RouteContainer from "../route-container";import ThemeProvider from "../theme-provider";@@ -10,7 +11,11 @@ var cache = {};function CachedRouter() {const [RouteResult, location] = useRoutes(routes, {fallbackRoute: getHomeRoute(),+ hooks: {+ beforeNavigate: () => selectionStore.toggleSelectionMode(false),+ },});+useEffect(() => {if (!RouteResult) return;NavigationEvents.publish("onNavigate", RouteResult, location);