mirror of
https://github.com/penpot/penpot.git
synced 2025-01-06 14:50:20 -05:00
Merge pull request #5370 from penpot/niwinz-bugfix-4
🐛 Fix incorrect access to flows on add-new-interaction event
This commit is contained in:
commit
59e5656bd7
2 changed files with 14 additions and 12 deletions
|
@ -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))
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue