mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
🐛 Fix components without root shape for v2 migration
This commit is contained in:
parent
9f6b82dfc0
commit
dc67056a8c
1 changed files with 5 additions and 3 deletions
|
@ -431,9 +431,11 @@
|
|||
fix-empty-components
|
||||
(fn [file-data]
|
||||
(letfn [(fix-component [components id component]
|
||||
(if (empty? (:objects component))
|
||||
(let [root-shape (ctst/get-shape component (:id component))]
|
||||
(if (or (empty? (:objects component))
|
||||
(nil? root-shape))
|
||||
(dissoc components id)
|
||||
components))]
|
||||
components)))]
|
||||
|
||||
(-> file-data
|
||||
(d/update-when :components #(reduce-kv fix-component % %)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue