mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 12:12:54 +01:00
fix: toggle selection mode to false on navigate
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user