From bd9874cf281c06a7cee5282f02eaa2b8beef3a62 Mon Sep 17 00:00:00 2001 From: AzazelN28 Date: Wed, 20 Mar 2024 16:42:20 +0100 Subject: [PATCH] :bug: Fix exit edit path mode --- frontend/src/app/main/data/workspace/common.cljs | 14 +++++++------- .../app/main/data/workspace/path/shortcuts.cljs | 8 ++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/main/data/workspace/common.cljs b/frontend/src/app/main/data/workspace/common.cljs index 063c1e50a..d140bdb6b 100644 --- a/frontend/src/app/main/data/workspace/common.cljs +++ b/frontend/src/app/main/data/workspace/common.cljs @@ -168,13 +168,6 @@ ;; Toolbar ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defn toggle-toolbar-visibility - [] - (ptk/reify ::toggle-toolbar-visibility - ptk/UpdateEvent - (update [_ state] - (update-in state [:workspace-local :hide-toolbar] not)))) - (defn hide-toolbar [] (ptk/reify ::hide-toolbar @@ -188,3 +181,10 @@ ptk/UpdateEvent (update [_ state] (assoc-in state [:workspace-local :hide-toolbar] false)))) + +(defn toggle-toolbar-visibility + [] + (ptk/reify ::toggle-toolbar-visibility + ptk/UpdateEvent + (update [_ state] + (update-in state [:workspace-local :hide-toolbar] not)))) diff --git a/frontend/src/app/main/data/workspace/path/shortcuts.cljs b/frontend/src/app/main/data/workspace/path/shortcuts.cljs index 653b6659e..07fb3b1fa 100644 --- a/frontend/src/app/main/data/workspace/path/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/path/shortcuts.cljs @@ -22,13 +22,9 @@ (defn esc-pressed [] (ptk/reify ::esc-pressed ptk/WatchEvent - (watch [_ state _] + (watch [_ _ _] ;; Not interrupt when we're editing a path - (let [edition-id (or (get-in state [:workspace-drawing :object :id]) - (get-in state [:workspace-local :edition])) - path-edit-mode (get-in state [:workspace-local :edit-path edition-id :edit-mode])] - (when-not (= :draw path-edit-mode) - (rx/of :interrupt)))))) + (rx/of :interrupt)))) (def shortcuts {:move-nodes {:tooltip "M"