mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 06:02:32 -05:00
Add function to verify already used names
This commit is contained in:
parent
deb9cb1120
commit
1596dbe155
1 changed files with 6 additions and 0 deletions
|
@ -80,6 +80,12 @@
|
|||
{::mf/wrap-props false}
|
||||
[{:keys [token-type x y position fields token] :as args}]
|
||||
(let [tokens (sd/use-resolved-workspace-tokens {:debug? true})
|
||||
used-token-names (mf/use-memo
|
||||
(mf/deps tokens)
|
||||
(fn []
|
||||
(-> (into #{} (map (fn [[_ {:keys [name]}]] name) tokens))
|
||||
;; Allow setting token to already used name
|
||||
(disj (:name token)))))
|
||||
vport (mf/deref viewport)
|
||||
style (calculate-position vport position x y)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue