fix: toggle selection mode to false on navigate

This commit is contained in:
thecodrr
2021-01-13 00:01:35 +05:00
parent 49ca056b49
commit 7b2b1fc20f

View File

@@ -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) {