mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 11:56:12 +02:00
🐛 Fix components without id
This commit is contained in:
parent
09ba1c262b
commit
fb7d3676d2
1 changed files with 12 additions and 0 deletions
|
@ -602,6 +602,17 @@
|
||||||
(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-components-without-id
|
||||||
|
(fn [file-data]
|
||||||
|
;; We have detected some components that have no :id attribute.
|
||||||
|
;; Regenerate it from the components map.
|
||||||
|
(letfn [(fix-component [id component]
|
||||||
|
(if (some? (:id component))
|
||||||
|
component
|
||||||
|
(assoc component :id id)))]
|
||||||
|
(-> file-data
|
||||||
|
(d/update-when :components #(d/mapm fix-component %)))))
|
||||||
|
|
||||||
remap-refs
|
remap-refs
|
||||||
(fn [file-data]
|
(fn [file-data]
|
||||||
;; Remap shape-refs so that they point to the near main.
|
;; Remap shape-refs so that they point to the near main.
|
||||||
|
@ -810,6 +821,7 @@
|
||||||
(fix-orphan-copies)
|
(fix-orphan-copies)
|
||||||
(remove-nested-roots)
|
(remove-nested-roots)
|
||||||
(add-not-nested-roots)
|
(add-not-nested-roots)
|
||||||
|
(fix-components-without-id)
|
||||||
(remap-refs)
|
(remap-refs)
|
||||||
(fix-converted-copies)
|
(fix-converted-copies)
|
||||||
(transform-to-frames)
|
(transform-to-frames)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue