0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 00:19:07 -05:00

🐛 Fix problem with nil children

This commit is contained in:
alonso.torres 2024-01-22 10:53:39 +01:00 committed by Andrey Antukh
parent 844634e8c8
commit ff72a9ce70

View file

@ -24,22 +24,23 @@
;; FIXME: revisit this:
(defn propagate-wrapper-styles-child
[child wrapper-props]
(let [child-props-childs
(-> (obj/get child "props")
(obj/clone)
(-> (obj/get "childs")))
(when (some? child)
(let [child-props-childs
(-> (obj/get child "props")
(obj/clone)
(-> (obj/get "childs")))
child-props-childs
(->> child-props-childs
(map #(assoc % :wrapper-styles (obj/get wrapper-props "style"))))
child-props-childs
(->> child-props-childs
(map #(assoc % :wrapper-styles (obj/get wrapper-props "style"))))
child-props
(-> (obj/get child "props")
(obj/clone)
(obj/set! "childs" child-props-childs))]
child-props
(-> (obj/get child "props")
(obj/clone)
(obj/set! "childs" child-props-childs))]
(-> (obj/clone child)
(obj/set! "props" child-props))))
(-> (obj/clone child)
(obj/set! "props" child-props)))))
(defn propagate-wrapper-styles
([children wrapper-props]