0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-04 21:38:53 -05:00

🐛 Use helper to normalice behavior of component display in dump_tree

This commit is contained in:
Andrés Moya 2023-09-12 09:43:30 +02:00
parent 3228d0a95f
commit 51ab11e91e

View file

@ -645,17 +645,13 @@
(str " #" (when show-ids (str/format " [Component %s]" (:component-id shape)))) (str " #" (when show-ids (str/format " [Component %s]" (:component-id shape))))
"") "")
(let [root-shape (ctn/get-component-shape objects shape) (let [root-shape (ctn/get-component-shape objects shape)
component-id (when root-shape (:component-id root-shape))
component-file-id (when root-shape (:component-file root-shape)) component-file-id (when root-shape (:component-file root-shape))
component-file (when component-file-id (get libraries component-file-id nil)) component-file (when component-file-id (get libraries component-file-id nil))
component (when component-id component-shape (find-ref-shape file
(if component-file {:objects objects}
(ctkl/get-component (:data component-file) component-id true) libraries
(ctkl/get-component (:data file) component-id true))) shape
component-shape (when component :include-deleted? true)]
(if component-file
(get-ref-shape (:data component-file) component shape)
(get-ref-shape (:data file) component shape)))]
(str/format " %s--> %s%s%s%s%s" (str/format " %s--> %s%s%s%s%s"
(cond (:component-root shape) "#" (cond (:component-root shape) "#"