mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
🐛 Remove empty text shapes on comp-v2 migration
This commit is contained in:
parent
b1d33d4c15
commit
623b4a9858
1 changed files with 8 additions and 1 deletions
|
@ -243,13 +243,20 @@
|
|||
fix-completly-broken-shapes
|
||||
(fn [file-data]
|
||||
(letfn [(update-object [objects id shape]
|
||||
(if (nil? (:type shape))
|
||||
(cond
|
||||
(nil? (:type shape))
|
||||
(let [ids (cfh/get-children-ids objects id)]
|
||||
(-> objects
|
||||
(dissoc id)
|
||||
(as-> $ (reduce dissoc $ ids))
|
||||
(d/update-in-when [(:parent-id shape) :shapes]
|
||||
(fn [shapes] (filterv #(not= id %) shapes)))))
|
||||
|
||||
(and (cfh/text-shape? shape)
|
||||
(not (seq (:content shape))))
|
||||
(dissoc objects id)
|
||||
|
||||
:else
|
||||
objects))
|
||||
|
||||
(update-container [container]
|
||||
|
|
Loading…
Add table
Reference in a new issue