🐛 Fix incorrect access to flows on add-new-interaction event

This commit is contained in:
Andrey Antukh 2024-11-25 13:29:08 +01:00
parent 8448036d67
commit 723eef9565
2 changed files with 14 additions and 12 deletions

View file

@ -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]