mirror of
https://github.com/penpot/penpot.git
synced 2025-03-18 10:41:29 -05:00
🐛 Fix remove nested roots on components v2 migration
This commit is contained in:
parent
a5fc42cafa
commit
8d65998cc3
1 changed files with 6 additions and 7 deletions
|
@ -944,12 +944,12 @@
|
|||
;;
|
||||
;; WARNING: THIS SHOULD BE CALLED AT THE END OF THE PROCESS.
|
||||
(letfn [(fix-container [container]
|
||||
(d/update-when container :objects update-vals fix-shape))
|
||||
|
||||
(fix-shape [shape]
|
||||
(cond-> shape
|
||||
(reduce fix-shape container (ctn/shapes-seq container)))
|
||||
(fix-shape [container shape]
|
||||
(cond-> container
|
||||
(@detached-ids (:shape-ref shape))
|
||||
(ctk/detach-shape)))]
|
||||
(detach-shape shape)))]
|
||||
|
||||
(-> file-data
|
||||
(update :pages-index update-vals fix-container)
|
||||
(d/update-when :components update-vals fix-container))))]
|
||||
|
@ -986,8 +986,7 @@
|
|||
(fix-false-copies)
|
||||
(fix-component-root-without-component)
|
||||
(fix-copies-of-detached); <- Do not add fixes after this and fix-orphan-copies call
|
||||
; This extra call to fix-orphan-copies after fix-copies-of-detached because we can have detached subtrees with invalid shape-ref attributes
|
||||
(fix-orphan-copies))))
|
||||
)))
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; COMPONENTS MIGRATION
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Reference in a new issue