diff --git a/frontend/src/app/main/ui/ds/notifications/actionable.cljs b/frontend/src/app/main/ui/ds/notifications/actionable.cljs index f97ef075e0..c14370d121 100644 --- a/frontend/src/app/main/ui/ds/notifications/actionable.cljs +++ b/frontend/src/app/main/ui/ds/notifications/actionable.cljs @@ -34,12 +34,14 @@ on-accept (mf/use-fn + (mf/deps on-accept) (fn [e] (when (fn? on-accept) (on-accept e)))) on-cancel (mf/use-fn + (mf/deps on-cancel) (fn [e] (when on-cancel (on-cancel e))))] diff --git a/frontend/src/app/main/ui/workspace/shapes.cljs b/frontend/src/app/main/ui/workspace/shapes.cljs index d1889e620e..06f3731c5e 100644 --- a/frontend/src/app/main/ui/workspace/shapes.cljs +++ b/frontend/src/app/main/ui/workspace/shapes.cljs @@ -60,10 +60,11 @@ {::mf/wrap [mf/memo] ::mf/wrap-props false} [props] - (let [objects (obj/get props "objects") - active-frames (obj/get props "active-frames") - shapes (cfh/get-immediate-children objects) - vbox (mf/use-ctx ctx/current-vbox) + (let [objects (obj/get props "objects") + active-frames (obj/get props "active-frames") + disable-thumbnails (obj/get props "disable-thumbnails") + shapes (cfh/get-immediate-children objects) + vbox (mf/use-ctx ctx/current-vbox) frame-overlap? (mf/with-memo [vbox objects] #(make-is-frame-overlap vbox objects)) @@ -84,13 +85,16 @@ [:g.frame-children (for [shape shapes] - [:g.ws-shape-wrapper {:key (dm/str (dm/get-prop shape :id))} - (if ^boolean (cfh/frame-shape? shape) - [:& root-frame-wrapper - {:shape shape - :objects objects - :thumbnail? (not (contains? active-frames (dm/get-prop shape :id)))}] - [:& shape-wrapper {:shape shape}])])]]])) + (let [thumbnail? + (and (not disable-thumbnails) + (contains? active-frames (dm/get-prop shape :id)))] + [:g.ws-shape-wrapper {:key (dm/str (dm/get-prop shape :id))} + (if ^boolean (cfh/frame-shape? shape) + [:& root-frame-wrapper + {:shape shape + :objects objects + :thumbnail? thumbnail?}] + [:& shape-wrapper {:shape shape}])]))]]])) (mf/defc shape-wrapper {::mf/wrap [#(mf/memo' % common/check-shape-props)] diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index 9cd8c4ef6e..75cfbf4444 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -410,7 +410,9 @@ ;; Render root shape [:& shapes/root-shape {:key (str page-id) :objects base-objects - :active-frames @active-frames}]]]] + :active-frames @active-frames + ;; disable thumbnails when previewing a version + :disable-thumbnails (some? preview-id)}]]]] [:svg.viewport-controls {:xmlns "http://www.w3.org/2000/svg"