From cd1825d97a7b5c9550a5fefcfce1993f159bc90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Fri, 12 May 2023 16:40:38 +0200 Subject: [PATCH] Revert ":bug: Fix undo when deleting shapes inside instances" This reverts commit c421059e976a36ada5acc41346f539bddf1cf57b. --- .../src/app/main/data/workspace/shapes.cljs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/main/data/workspace/shapes.cljs b/frontend/src/app/main/data/workspace/shapes.cljs index e871f37b8..87748a6ca 100644 --- a/frontend/src/app/main/data/workspace/shapes.cljs +++ b/frontend/src/app/main/data/workspace/shapes.cljs @@ -208,14 +208,10 @@ (recur (rest ids-seq) (conj ids-to-delete id) ids-to-hide))))) - [ids []]) - - undo-id (js/Symbol)] + [ids []])] - (rx/of (dwu/start-undo-transaction undo-id) - (update-shape-flags ids-to-hide {:hidden true}) - (real-delete-shapes file page objects ids-to-delete it components-v2) - (dwu/commit-undo-transaction undo-id))))))) + (rx/concat (rx/of (update-shape-flags ids-to-hide {:hidden true})) + (real-delete-shapes file page objects ids-to-delete it components-v2))))))) (defn- real-delete-shapes [file page objects ids it components-v2] @@ -335,11 +331,14 @@ (cond-> (seq starting-flows) (pcb/update-page-option :flows (fn [flows] (->> (map :id starting-flows) - (reduce ctp/remove-flow flows))))))] + (reduce ctp/remove-flow flows)))))) + undo-id (js/Symbol)] - (rx/of (dc/detach-comment-thread ids) + (rx/of (dwu/start-undo-transaction undo-id) + (dc/detach-comment-thread ids) (ptk/data-event :layout/update all-parents) - (dch/commit-changes changes)))) + (dch/commit-changes changes) + (dwu/commit-undo-transaction undo-id)))) (defn create-and-add-shape [type frame-x frame-y data]