mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
Add token set deletion
This commit is contained in:
@@ -737,7 +737,7 @@
|
||||
[changes token-set-id]
|
||||
(assert-library! changes)
|
||||
(let [library-data (::library-data (meta changes))
|
||||
prev-token-set (get-in library-data [:token-set token-set-id])]
|
||||
prev-token-set (get-in library-data [:token-sets-index token-set-id])]
|
||||
(-> changes
|
||||
(update :redo-changes conj {:type :del-token-set :id token-set-id})
|
||||
(update :undo-changes conj {:type :add-token-set :token-set prev-token-set})
|
||||
|
||||
@@ -51,5 +51,8 @@
|
||||
(d/update-in-when file-data [:token-sets-index token-set-id] #(-> (apply f % args) (touch))))
|
||||
|
||||
(defn delete-token-set
|
||||
[file-data token-id]
|
||||
file-data)
|
||||
[file-data token-set-id]
|
||||
(-> file-data
|
||||
(update :token-set-groups (fn [xs] (into [] (remove #(= (:id %) token-set-id) xs))))
|
||||
(update :token-sets-index dissoc token-set-id)
|
||||
(update :token-themes-index (fn [xs] (update-vals xs #(update % :sets disj token-set-id))))))
|
||||
|
||||
Reference in New Issue
Block a user