From 4118e53d7d9f68531479a460a904efbd7dd66c1c Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 10 May 2021 16:48:26 +0200 Subject: [PATCH] :bug: Fix problem with undo --- frontend/src/app/main/data/workspace/changes.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/changes.cljs b/frontend/src/app/main/data/workspace/changes.cljs index 37a95099a..7153223b3 100644 --- a/frontend/src/app/main/data/workspace/changes.cljs +++ b/frontend/src/app/main/data/workspace/changes.cljs @@ -69,6 +69,7 @@ (watch [_ state stream] (let [page-id (:current-page-id state) objects (get-in state [:workspace-data :pages-index page-id :objects]) + objects' (get-in state [:workspace-file :data :pages-index page-id :objects]) reg-objects {:type :reg-objects :page-id page-id :shapes (vec ids)}] (loop [ids (seq ids) rch [] @@ -84,8 +85,9 @@ (let [id (first ids) obj1 (get objects id) obj2 (f obj1) + obj3 (get objects' id) rch-operations (generate-operations obj1 obj2) - uch-operations (generate-operations obj2 obj1 true) + uch-operations (generate-operations obj2 obj3 true) rchg {:type :mod-obj :page-id page-id :operations rch-operations