From 7b2d11019c5df9bac53877c6bdbaae8780e28132 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Mon, 8 Jul 2024 15:10:01 +0200 Subject: [PATCH] Only show atrribute actions when shapes are selected --- frontend/src/app/main/ui/workspace/tokens/context_menu.cljs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs b/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs index 85c0c91a8..ee43e98d9 100644 --- a/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs @@ -277,7 +277,8 @@ (defn generate-menu-entries [{:keys [token-id token-type-props _token-type _selected-shapes] :as context-data}] (let [{:keys [modal]} token-type-props - attribute-actions (shape-attribute-actions context-data) + attribute-actions (when (seq selected-shapes) + (shape-attribute-actions context-data)) default-actions [{:title "Delete Token" :action #(st/emit! (dt/delete-token token-id))} {:title "Duplicate Token" :action #(st/emit! (dt/duplicate-token token-id))} {:title "Edit Token" :action (fn [event] @@ -292,7 +293,7 @@ :token token})))}]] (concat attribute-actions - [:separator] + (when attribute-actions [:separator]) default-actions))) (mf/defc token-pill-context-menu