mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 07:29:08 -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
|
fix-empty-components
|
||||||
(fn [file-data]
|
(fn [file-data]
|
||||||
(letfn [(fix-component [components id component]
|
(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)
|
(dissoc components id)
|
||||||
components))]
|
components)))]
|
||||||
|
|
||||||
(-> file-data
|
(-> file-data
|
||||||
(d/update-when :components #(reduce-kv fix-component % %)))))
|
(d/update-when :components #(reduce-kv fix-component % %)))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue