0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 16:30:37 -05:00

🐛 Fix data inconsistency on wrong deletion ordering.

This commit is contained in:
Andrey Antukh 2020-03-12 11:33:00 +01:00
parent b3747ee0e7
commit d506c9b562

View file

@ -1253,15 +1253,12 @@
(defn- delete-shapes
[ids]
(us/assert ::set-of-uuid ids)
(us/assert (s/coll-of ::us/uuid) ids)
(ptk/reify ::delete-shapes
ptk/WatchEvent
(watch [_ state stream]
(let [objects (get-in state [:workspace-data :objects])
session-id (:session-id state)
ids (seq ids)
rchanges (mapv #(array-map :type :del-obj :id %) ids)
uchanges (mapv (fn [id]
(let [obj (get objects id)
@ -1282,7 +1279,7 @@
(watch [_ state stream]
(let [objects (get-in state [:workspace-data :objects])
obj (get objects id)
ids (d/concat #{} (:shapes obj) [(:id obj)])]
ids (d/concat [] (:shapes obj) [(:id obj)])]
(rx/of (delete-shapes ids))))))
(def delete-selected