mirror of
https://github.com/penpot/penpot.git
synced 2026-05-05 16:18:35 +00:00
🐛 Fix problem with duplicate in main component
This commit is contained in:
parent
3bbf97fde9
commit
786513863b
@ -240,3 +240,13 @@
|
||||
(distinct)
|
||||
(filter #(not (eq % (get comp1 %) (get comp2 %))))
|
||||
set)))
|
||||
|
||||
(defn allow-duplicate?
|
||||
[objects shape]
|
||||
|
||||
(let [parent (get objects (:parent-id shape))]
|
||||
;; We don't want to change the structure of component copies
|
||||
(and (not (in-component-copy-not-head? shape))
|
||||
;; Non instance, non copy. We allow
|
||||
(or (not (instance-head? shape))
|
||||
(not (in-component-copy? parent))))))
|
||||
|
||||
@ -709,8 +709,8 @@
|
||||
(let [page (wsh/lookup-page state)
|
||||
objects (:objects page)
|
||||
selected (->> (wsh/lookup-selected state)
|
||||
(map #(get objects %))
|
||||
(remove #(ctk/in-component-copy-not-root? %)) ;; We don't want to change the structure of component copies
|
||||
(map (d/getf objects))
|
||||
(filter #(ctk/allow-duplicate? objects %))
|
||||
(map :id)
|
||||
set)]
|
||||
(when (seq selected)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user