mirror of
https://github.com/penpot/penpot.git
synced 2026-05-01 06:08:09 +00:00
🐛 Add validation fix for false non root copies
This commit is contained in:
parent
cceb35b053
commit
17a208d67b
@ -486,15 +486,18 @@
|
||||
fix-false-copies
|
||||
(fn [file-data]
|
||||
;; Find component heads that are not main-instance but have not :shape-ref.
|
||||
;; Also shapes that have :shape-ref but are not in a copy.
|
||||
(letfn [(fix-container
|
||||
[container]
|
||||
(d/update-when container :objects update-vals (partial fix-shape container)))
|
||||
|
||||
(fix-shape
|
||||
[container shape]
|
||||
(if (and (ctk/instance-head? shape)
|
||||
(not (ctk/main-instance? shape))
|
||||
(not (ctk/in-component-copy? shape)))
|
||||
(if (or (and (ctk/instance-head? shape)
|
||||
(not (ctk/main-instance? shape))
|
||||
(not (ctk/in-component-copy? shape)))
|
||||
(and (ctk/in-component-copy? shape)
|
||||
(nil? (ctn/get-head-shape (:objects container) shape {:allow-main? true}))))
|
||||
(detach-shape container shape)
|
||||
shape))]
|
||||
(-> file-data
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user