mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 21:41:40 +02:00
🐛 Fix problem with nil children
This commit is contained in:
parent
844634e8c8
commit
ff72a9ce70
1 changed files with 14 additions and 13 deletions
|
@ -24,22 +24,23 @@
|
||||||
;; FIXME: revisit this:
|
;; FIXME: revisit this:
|
||||||
(defn propagate-wrapper-styles-child
|
(defn propagate-wrapper-styles-child
|
||||||
[child wrapper-props]
|
[child wrapper-props]
|
||||||
(let [child-props-childs
|
(when (some? child)
|
||||||
(-> (obj/get child "props")
|
(let [child-props-childs
|
||||||
(obj/clone)
|
(-> (obj/get child "props")
|
||||||
(-> (obj/get "childs")))
|
(obj/clone)
|
||||||
|
(-> (obj/get "childs")))
|
||||||
|
|
||||||
child-props-childs
|
child-props-childs
|
||||||
(->> child-props-childs
|
(->> child-props-childs
|
||||||
(map #(assoc % :wrapper-styles (obj/get wrapper-props "style"))))
|
(map #(assoc % :wrapper-styles (obj/get wrapper-props "style"))))
|
||||||
|
|
||||||
child-props
|
child-props
|
||||||
(-> (obj/get child "props")
|
(-> (obj/get child "props")
|
||||||
(obj/clone)
|
(obj/clone)
|
||||||
(obj/set! "childs" child-props-childs))]
|
(obj/set! "childs" child-props-childs))]
|
||||||
|
|
||||||
(-> (obj/clone child)
|
(-> (obj/clone child)
|
||||||
(obj/set! "props" child-props))))
|
(obj/set! "props" child-props)))))
|
||||||
|
|
||||||
(defn propagate-wrapper-styles
|
(defn propagate-wrapper-styles
|
||||||
([children wrapper-props]
|
([children wrapper-props]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue