From a09198b46e0ac1d7268affb4d936abb80747e80a Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Wed, 25 Jan 2023 13:05:03 +0100 Subject: [PATCH] :bug: Fix wrong pop on setup shortcuts --- .../src/app/main/ui/workspace/viewport/hooks.cljs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs index 27f2cbef8..b07d11210 100644 --- a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs @@ -342,10 +342,10 @@ (mf/use-effect (mf/deps path-editing? drawing-path?) (fn [] - (when (or drawing-path? path-editing?) - (st/emit! (dsc/push-shortcuts ::path psc/shortcuts)) - #(st/emit! (dsc/pop-shortcuts ::path))) - - (when text-editing? - (st/emit! (dsc/push-shortcuts ::text tsc/shortcuts)) - #(st/emit! (dsc/pop-shortcuts ::text)))))) + (cond + (or drawing-path? path-editing?) + (do (st/emit! (dsc/push-shortcuts ::path psc/shortcuts)) + #(st/emit! (dsc/pop-shortcuts ::path))) + text-editing? + (do (st/emit! (dsc/push-shortcuts ::text tsc/shortcuts)) + #(st/emit! (dsc/pop-shortcuts ::text)))))))