From d2bfd98a050c00c2b74c0d795764f46311d7ca82 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 20 Jun 2023 13:28:31 +0200 Subject: [PATCH] :bug: Fix right click options over layer or shape --- frontend/src/app/main/data/workspace.cljs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 4ce4dc2ee7..200b29695d 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1258,17 +1258,18 @@ not-group-like? (and (= (count selected) 1) (not (contains? #{:group :bool} (:type head)))) no-bool-shapes? (->> all-selected (some (comp #{:frame :text} :type)))] - - (rx/concat - (when (and (some? shape) (not (contains? selected (:id shape)))) - (rx/of (dws/select-shape (:id shape)))) - (rx/of (show-context-menu - (-> params - (assoc - :kind :shape - :disable-booleans? (or no-bool-shapes? not-group-like?) - :disable-flatten? no-bool-shapes? - :selected (conj selected (:id shape))))))))))) + + (if (and (some? shape) (not (contains? selected (:id shape)))) + (rx/concat + (rx/of (dws/select-shape (:id shape))) + (rx/of (show-shape-context-menu params))) + (rx/of (show-context-menu + (-> params + (assoc + :kind :shape + :disable-booleans? (or no-bool-shapes? not-group-like?) + :disable-flatten? no-bool-shapes? + :selected (conj selected (:id shape))))))))))) (defn show-page-item-context-menu [{:keys [position page] :as params}]