diff --git a/frontend/src/app/main/ui/workspace/tokens/sets.cljs b/frontend/src/app/main/ui/workspace/tokens/sets.cljs index 06577fcf4..11db39e78 100644 --- a/frontend/src/app/main/ui/workspace/tokens/sets.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/sets.cljs @@ -93,7 +93,8 @@ (st/emit! (wdt/show-token-set-context-menu {:position (dom/get-client-position event) - :token-set-id id})))))] + :token-set-id id + :token-set-name name})))))] [:div {:class (stl/css :set-item-container) :on-click on-select :on-double-click #(on-edit id) diff --git a/frontend/src/app/main/ui/workspace/tokens/sets_context_menu.cljs b/frontend/src/app/main/ui/workspace/tokens/sets_context_menu.cljs index f77f5b022..922f44858 100644 --- a/frontend/src/app/main/ui/workspace/tokens/sets_context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/sets_context_menu.cljs @@ -28,11 +28,11 @@ [:span {:class (stl/css :title)} title]]) (mf/defc menu - [{:keys [token-set-id]}] + [{:keys [token-set-id token-set-name]}] (let [{:keys [on-edit]} (sets-context/use-context)] [:ul {:class (stl/css :context-list)} [:& menu-entry {:title "Rename" :on-click #(on-edit token-set-id)}] - [:& menu-entry {:title "Delete" :on-click #(st/emit! (wdt/delete-token-set token-set-id))}]])) + [:& menu-entry {:title "Delete" :on-click #(st/emit! (wdt/delete-token-set token-set-id token-set-name))}]])) (mf/defc sets-context-menu [] @@ -41,7 +41,8 @@ left (+ (get-in mdata [:position :x]) 5) width (mf/use-state 0) dropdown-ref (mf/use-ref) - token-set-id (:token-set-id mdata)] + token-set-id (:token-set-id mdata) + token-set-name (:token-set-name mdata)] (mf/use-effect (mf/deps mdata) (fn [] @@ -53,4 +54,5 @@ :ref dropdown-ref :style {:top top :left left} :on-context-menu prevent-default} - [:& menu {:token-set-id token-set-id}]]])) + [:& menu {:token-set-id token-set-id + :token-set-name token-set-name}]]]))