From 9d6bd640274182f9d91c7dc26526fdcd5a5ba451 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 20 Sep 2023 09:35:05 +0200 Subject: [PATCH] :bug: Fix problem with changes builder --- .../src/app/common/pages/changes_builder.cljc | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/common/src/app/common/pages/changes_builder.cljc b/common/src/app/common/pages/changes_builder.cljc index a57f7f0db..af9b5f452 100644 --- a/common/src/app/common/pages/changes_builder.cljc +++ b/common/src/app/common/pages/changes_builder.cljc @@ -376,14 +376,23 @@ attrs (seq attrs)] (if-let [attr (first attrs)] (let [old-val (get old attr) - new-val (get new attr)] + new-val (get new attr) + changed? (not= old-val new-val) - (recur (conj rops {:type :set :attr attr :val new-val - :ignore-geometry ignore-geometry? - :ignore-touched ignore-touched}) - (conj uops {:type :set :attr attr :val old-val - :ignore-touched true}) - (rest attrs))) + rops + (cond-> rops + changed? + (conj {:type :set :attr attr :val new-val + :ignore-geometry ignore-geometry? + :ignore-touched ignore-touched})) + + uops + (cond-> uops + changed? + (conj {:type :set :attr attr :val old-val + :ignore-touched true}))] + + (recur rops uops (rest attrs))) [rops uops]))) update-shape