mirror of
https://github.com/penpot/penpot.git
synced 2025-01-06 14:50:20 -05:00
move delete token to tokens actions section
This commit is contained in:
parent
5fa2048b23
commit
d3d454a43c
1 changed files with 12 additions and 12 deletions
|
@ -75,6 +75,18 @@
|
|||
(pcb/add-token token))]
|
||||
(rx/of (dch/commit-changes changes)))))))
|
||||
|
||||
(defn delete-token
|
||||
[id]
|
||||
(dm/assert! (uuid? id))
|
||||
(ptk/reify ::delete-token
|
||||
ptk/WatchEvent
|
||||
(watch [it state _]
|
||||
(let [data (get state :workspace-data)
|
||||
changes (-> (pcb/empty-changes it)
|
||||
(pcb/with-library-data data)
|
||||
(pcb/delete-token id))]
|
||||
(rx/of (dch/commit-changes changes))))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; TEMP (Move to test)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -125,15 +137,3 @@
|
|||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
(assoc-in state [:workspace-local :token-context-menu] nil))))
|
||||
|
||||
(defn delete-token
|
||||
[id]
|
||||
(dm/assert! (uuid? id))
|
||||
(ptk/reify ::delete-token
|
||||
ptk/WatchEvent
|
||||
(watch [it state _]
|
||||
(let [data (get state :workspace-data)
|
||||
changes (-> (pcb/empty-changes it)
|
||||
(pcb/with-library-data data)
|
||||
(pcb/delete-token id))]
|
||||
(rx/of (dch/commit-changes changes))))))
|
Loading…
Reference in a new issue