mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
🐛 Fix parent not found
This commit is contained in:
parent
317f83e3ec
commit
f864424d14
1 changed files with 18 additions and 1 deletions
|
@ -615,7 +615,23 @@
|
|||
:component-root)))]
|
||||
(-> file-data
|
||||
(update :pages-index update-vals fix-container)
|
||||
(d/update-when :components update-vals fix-container))))]
|
||||
(d/update-when :components update-vals fix-container))))
|
||||
|
||||
fix-shape-nil-parent-id
|
||||
(fn [file-data]
|
||||
;; Ensure that parent-id and frame-id are not nil
|
||||
(letfn [(fix-container [container]
|
||||
(d/update-when container :objects update-vals fix-shape))
|
||||
|
||||
(fix-shape [shape]
|
||||
(let [frame-id (or (:frame-id shape)
|
||||
uuid/zero)
|
||||
parent-id (or (:parent-id shape)
|
||||
frame-id)]
|
||||
(assoc shape :frame-id frame-id
|
||||
:parent-id parent-id)))]
|
||||
(-> file-data
|
||||
(update :pages-index update-vals fix-container))))]
|
||||
|
||||
(-> file-data
|
||||
(delete-invalid-flows)
|
||||
|
@ -638,6 +654,7 @@
|
|||
(fix-frame-ids)
|
||||
(fix-component-nil-objects)
|
||||
(fix-false-copies)
|
||||
(fix-shape-nil-parent-id)
|
||||
(fix-copies-of-detached)))) ; <- Do not add fixes after this one
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Reference in a new issue