From cbd5d42069cd441d61d0b5f3d47e0b4785f106e5 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Wed, 24 Jul 2024 13:36:38 +0200 Subject: [PATCH] Simplify --- .../app/main/ui/workspace/tokens/context_menu.cljs | 11 ++++------- 1 file changed, 4 insertions(+), 7 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 022da6dd5..7c2028160 100644 --- a/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs @@ -364,14 +364,11 @@ (generic-attribute-actions #{:x} "X" context-data) (generic-attribute-actions #{:y} "Y" context-data)))})) -(defn shape-attribute-actions [{:keys [type token] :as context-data}] - (when-let [with-actions (get shape-attribute-actions-map (or type (:type token)))] - (with-actions context-data))) - -(defn generate-menu-entries [{:keys [token selected-shapes] :as context-data}] +(defn generate-menu-entries [{:keys [type token] :as context-data}] (let [{:keys [modal]} (get wtc/token-types (:type token)) - attribute-actions (when (seq selected-shapes) - (shape-attribute-actions context-data)) + with-actions (get shape-attribute-actions-map (or type (:type token))) + attribute-actions (when with-actions + (with-actions context-data)) default-actions [{:title "Delete Token" :action #(st/emit! (dt/delete-token (:id token)))} {:title "Duplicate Token"