🔥 Remove unused conditional on root-shape component

This commit is contained in:
Andrey Antukh 2023-08-28 15:57:13 +02:00
parent 82f1b96503
commit 1a1e55037b

View file

@ -53,9 +53,8 @@
;; We group the objects together per frame-id so if an object of a different ;; We group the objects together per frame-id so if an object of a different
;; frame changes won't affect the rendering frame ;; frame changes won't affect the rendering frame
frame-objects frame-objects
(mf/use-memo (mf/with-memo [objects]
(mf/deps objects) (cph/objects-by-frame objects))]
#(cph/objects-by-frame objects))]
[:g {:id (dm/str "shape-" uuid/zero)} [:g {:id (dm/str "shape-" uuid/zero)}
[:& (mf/provider ctx/active-frames) {:value active-frames} [:& (mf/provider ctx/active-frames) {:value active-frames}
@ -69,17 +68,12 @@
[:g.frame-children [:g.frame-children
(for [shape shapes] (for [shape shapes]
[:g.ws-shape-wrapper {:key (dm/str (dm/get-prop shape :id))} [:g.ws-shape-wrapper {:key (dm/str (dm/get-prop shape :id))}
(if (not ^boolean (cph/frame-shape? shape)) (if ^boolean (cph/frame-shape? shape)
[:& shape-wrapper [:& root-frame-wrapper
{:shape shape}] {:shape shape
(if ^boolean (cph/is-direct-child-of-root? shape) :objects (get frame-objects (dm/get-prop shape :id))
[:& root-frame-wrapper :thumbnail? (not (contains? active-frames (dm/get-prop shape :id)))}]
{:shape shape [:& shape-wrapper {:shape shape}])])]]]))
:objects (get frame-objects (dm/get-prop shape :id))
:thumbnail? (not (contains? active-frames (dm/get-prop shape :id)))}]
[:& nested-frame-wrapper
{:shape shape
:objects (get frame-objects (dm/get-prop shape :id))}]))])]]]))
(defn- check-shape-wrapper-props (defn- check-shape-wrapper-props
[np op] [np op]