mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 22:22:43 -05:00
Fix duplicate token event
This commit is contained in:
parent
b0d46e1767
commit
bfa90d0347
1 changed files with 10 additions and 5 deletions
|
@ -239,11 +239,16 @@
|
||||||
(rx/of (dch/commit-changes changes))))))
|
(rx/of (dch/commit-changes changes))))))
|
||||||
|
|
||||||
(defn duplicate-token
|
(defn duplicate-token
|
||||||
[id]
|
[token-name]
|
||||||
(let [new-token (-> (get-token-data-from-token-id id)
|
(dm/assert! (string? token-name))
|
||||||
(dissoc :id)
|
(ptk/reify ::duplicate-token
|
||||||
|
ptk/WatchEvent
|
||||||
|
(watch [_ state _]
|
||||||
|
(when-let [token (some-> (wtts/get-selected-token-set state)
|
||||||
|
(ctob/get-token token-name)
|
||||||
(update :name #(str/concat % "-copy")))]
|
(update :name #(str/concat % "-copy")))]
|
||||||
(update-create-token new-token)))
|
(rx/of
|
||||||
|
(update-create-token token))))))
|
||||||
|
|
||||||
(defn set-token-type-section-open
|
(defn set-token-type-section-open
|
||||||
[token-type open?]
|
[token-type open?]
|
||||||
|
|
Loading…
Add table
Reference in a new issue