mirror of
https://github.com/penpot/penpot.git
synced 2025-08-06 07:28:28 +02:00
✨ Add new metric for token update and provide token type
This commit is contained in:
parent
b893a62e40
commit
6de9de9e38
1 changed files with 5 additions and 3 deletions
|
@ -343,6 +343,7 @@
|
||||||
(watch [it state _]
|
(watch [it state _]
|
||||||
(if-let [token-set (lookup-token-set state)]
|
(if-let [token-set (lookup-token-set state)]
|
||||||
(let [data (dsh/lookup-file-data state)
|
(let [data (dsh/lookup-file-data state)
|
||||||
|
token-type (:type token)
|
||||||
changes (-> (pcb/empty-changes it)
|
changes (-> (pcb/empty-changes it)
|
||||||
(pcb/with-library-data data)
|
(pcb/with-library-data data)
|
||||||
(pcb/set-token (:name token-set)
|
(pcb/set-token (:name token-set)
|
||||||
|
@ -350,7 +351,7 @@
|
||||||
token))]
|
token))]
|
||||||
|
|
||||||
(rx/of (dch/commit-changes changes)
|
(rx/of (dch/commit-changes changes)
|
||||||
(ptk/data-event ::ev/event {::ev/name "create-token"})))
|
(ptk/data-event ::ev/event {::ev/name "create-token" :type token-type})))
|
||||||
|
|
||||||
(rx/of (create-token-with-set token)))))))
|
(rx/of (create-token-with-set token)))))))
|
||||||
|
|
||||||
|
@ -367,14 +368,15 @@
|
||||||
token' (->> (merge token params)
|
token' (->> (merge token params)
|
||||||
(into {})
|
(into {})
|
||||||
(ctob/make-token))
|
(ctob/make-token))
|
||||||
|
token-type (:type token)
|
||||||
changes (-> (pcb/empty-changes it)
|
changes (-> (pcb/empty-changes it)
|
||||||
(pcb/with-library-data data)
|
(pcb/with-library-data data)
|
||||||
(pcb/set-token (:name token-set)
|
(pcb/set-token (:name token-set)
|
||||||
(:name token)
|
(:name token)
|
||||||
token'))]
|
token'))]
|
||||||
|
|
||||||
(rx/of (dch/commit-changes changes))))))
|
(rx/of (dch/commit-changes changes)
|
||||||
|
(ptk/data-event ::ev/event {::ev/name "edit-token" :type token-type}))))))
|
||||||
|
|
||||||
(defn delete-token
|
(defn delete-token
|
||||||
[set-name token-name]
|
[set-name token-name]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue