From 7b2b1fc20f8a9130ffe4db9d9972fad186d647bf Mon Sep 17 00:00:00 2001 From: thecodrr Date: Wed, 13 Jan 2021 00:01:35 +0500 Subject: [PATCH] fix: toggle selection mode to false on navigate --- apps/web/src/utils/use-routes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/src/utils/use-routes.js b/apps/web/src/utils/use-routes.js index ea43e8a32..e4d4b8f27 100644 --- a/apps/web/src/utils/use-routes.js +++ b/apps/web/src/utils/use-routes.js @@ -1,11 +1,15 @@ import { useLocation } from "wouter"; import makeMatcher from "wouter/matcher"; import { navigate } from "../navigation"; +import { store as selectionStore } from "../stores/selection-store"; export default function useRoutes(routes, options) { const [location] = useLocation(); const matcher = makeMatcher(); + // TODO move this to an extension function + selectionStore.toggleSelectionMode(false); + for (var key in routes) { const [match, params] = matcher(key, location); if (match) {