diff --git a/common/src/app/common/logic/shapes.cljc b/common/src/app/common/logic/shapes.cljc index 24b89bc1a..a3dee6960 100644 --- a/common/src/app/common/logic/shapes.cljc +++ b/common/src/app/common/logic/shapes.cljc @@ -409,12 +409,14 @@ ;; Resize parent containers that need to (pcb/resize-parents parents)))) -(defn change-show-in-viewer [shape hide?] +(defn change-show-in-viewer + [shape hide?] (assoc shape :hide-in-viewer hide?)) -(defn add-new-interaction [shape interaction] - (-> shape - (update :interactions ctsi/add-interaction interaction))) +(defn add-new-interaction + [shape interaction] + (update shape :interactions ctsi/add-interaction interaction)) -(defn show-in-viewer [shape] +(defn show-in-viewer + [shape] (dissoc shape :hide-in-viewer)) diff --git a/frontend/src/app/main/data/workspace/interactions.cljs b/frontend/src/app/main/data/workspace/interactions.cljs index ef6230692..b5ae5352d 100644 --- a/frontend/src/app/main/data/workspace/interactions.cljs +++ b/frontend/src/app/main/data/workspace/interactions.cljs @@ -168,7 +168,7 @@ objects (get page :objects) frame (cfh/get-root-frame objects (:id shape)) - flows (get page :objects) + flows (get page :flows) flow (ctp/get-frame-flow flows (:id frame))] (rx/concat (rx/of (dwsh/update-shapes @@ -177,14 +177,14 @@ (let [new-interaction (-> ctsi/default-interaction (ctsi/set-destination destination) (assoc :position-relative-to (:id shape)))] - (cls/add-new-interaction shape new-interaction)))) + (cls/add-new-interaction shape new-interaction))))) - (when destination - (dwsh/update-shapes [destination] cls/show-in-viewer)) + (when destination + (rx/of (dwsh/update-shapes [destination] cls/show-in-viewer))) - (when (and (not (connected-frame? objects (:id frame))) - (nil? flow)) - (add-flow (:id frame)))))))))) + (when (and (not (connected-frame? objects (:id frame))) + (nil? flow)) + (rx/of (add-flow (:id frame)))))))))) (defn remove-interaction ([shape index]