mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 19:56:37 +02:00
🐛 Remove interactions when the destination artboard is deleted
This commit is contained in:
parent
e241273a1e
commit
af23d62568
4 changed files with 47 additions and 4 deletions
|
@ -331,7 +331,6 @@
|
|||
:shapes [shape-id]})))]
|
||||
(rx/of (dch/commit-changes rchanges uchanges {:commit-local? true}))))))
|
||||
|
||||
|
||||
(defn delete-shapes
|
||||
[ids]
|
||||
(us/assert (s/coll-of ::us/uuid) ids)
|
||||
|
@ -366,6 +365,12 @@
|
|||
#{}
|
||||
ids)
|
||||
|
||||
interacting-shapes
|
||||
(filter (fn [shape]
|
||||
(let [interactions (:interactions shape)]
|
||||
(some ids (map :destination interactions))))
|
||||
(vals objects))
|
||||
|
||||
rchanges
|
||||
(d/concat
|
||||
(reduce (fn [res id]
|
||||
|
@ -391,7 +396,18 @@
|
|||
:operations [{:type :set
|
||||
:attr :masked-group?
|
||||
:val false}])
|
||||
groups-to-unmask))
|
||||
groups-to-unmask)
|
||||
(map #(array-map
|
||||
:type :mod-obj
|
||||
:page-id page-id
|
||||
:id (:id %)
|
||||
:operations [{:type :set
|
||||
:attr :interactions
|
||||
:val (vec (remove (fn [interaction]
|
||||
(contains? ids (:destination interaction)))
|
||||
(:interactions %)))}])
|
||||
interacting-shapes))
|
||||
|
||||
|
||||
uchanges
|
||||
(d/concat
|
||||
|
@ -430,7 +446,15 @@
|
|||
:operations [{:type :set
|
||||
:attr :masked-group?
|
||||
:val true}])
|
||||
groups-to-unmask))]
|
||||
groups-to-unmask)
|
||||
(map #(array-map
|
||||
:type :mod-obj
|
||||
:page-id page-id
|
||||
:id (:id %)
|
||||
:operations [{:type :set
|
||||
:attr :interactions
|
||||
:val (:interactions %)}])
|
||||
interacting-shapes))]
|
||||
|
||||
;; (println "================ rchanges")
|
||||
;; (cljs.pprint/pprint rchanges)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue