mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 04:49:03 -05:00
🐛 Fix empty components on v2 migration
This commit is contained in:
parent
07693a46f2
commit
bdb16109d5
1 changed files with 11 additions and 0 deletions
|
@ -414,6 +414,16 @@
|
||||||
(update :pages-index update-vals fix-container)
|
(update :pages-index update-vals fix-container)
|
||||||
(d/update-when :components update-vals fix-container))))
|
(d/update-when :components update-vals fix-container))))
|
||||||
|
|
||||||
|
fix-empty-components
|
||||||
|
(fn [file-data]
|
||||||
|
(letfn [(fix-component [components id component]
|
||||||
|
(if (empty? (:objects component))
|
||||||
|
(dissoc components id)
|
||||||
|
components))]
|
||||||
|
|
||||||
|
(-> file-data
|
||||||
|
(d/update-when :components #(reduce-kv fix-component % %)))))
|
||||||
|
|
||||||
fix-misc-shape-issues
|
fix-misc-shape-issues
|
||||||
(fn [file-data]
|
(fn [file-data]
|
||||||
(letfn [(fix-container [container]
|
(letfn [(fix-container [container]
|
||||||
|
@ -919,6 +929,7 @@
|
||||||
(fix-broken-paths)
|
(fix-broken-paths)
|
||||||
(fix-big-geometry-shapes)
|
(fix-big-geometry-shapes)
|
||||||
(fix-shape-geometry)
|
(fix-shape-geometry)
|
||||||
|
(fix-empty-components)
|
||||||
(fix-completly-broken-shapes)
|
(fix-completly-broken-shapes)
|
||||||
(fix-bad-children)
|
(fix-bad-children)
|
||||||
(fix-broken-parents)
|
(fix-broken-parents)
|
||||||
|
|
Loading…
Add table
Reference in a new issue