From d506c9b562590a4928a7ec9ab390537c0c5b3856 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 12 Mar 2020 11:33:00 +0100 Subject: [PATCH] :bug: Fix data inconsistency on wrong deletion ordering. --- frontend/src/uxbox/main/data/workspace.cljs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 8af67981e..bfa5ed36c 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -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