From 66cd60e02ca8049abdd71a8566c8c5972472b5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Wed, 5 Oct 2022 10:05:22 +0200 Subject: [PATCH] :bug: Fix component sync in undo --- frontend/src/app/main/data/workspace/changes.cljs | 3 ++- frontend/src/app/main/data/workspace/libraries.cljs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/data/workspace/changes.cljs b/frontend/src/app/main/data/workspace/changes.cljs index c0acf9239..0b68bd1b7 100644 --- a/frontend/src/app/main/data/workspace/changes.cljs +++ b/frontend/src/app/main/data/workspace/changes.cljs @@ -150,7 +150,8 @@ :hint-origin (ptk/type origin) :changes redo-changes :page-id page-id - :frames frames}) + :frames frames + :save-undo? save-undo?}) ptk/UpdateEvent (update [_ state] diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index 7a97c584f..79b0ad4cf 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -842,11 +842,11 @@ check-changes (fn [[event data]] - (let [changes (-> event deref :changes) + (let [{:keys [changes save-undo?]} (deref event) components-changed (reduce #(into %1 (ch/components-changed data %2)) #{} changes)] - (when (d/not-empty? components-changed) + (when (and (d/not-empty? components-changed) save-undo?) (log/info :msg "DETECTED COMPONENTS CHANGED" :ids (map str components-changed)) (run! st/emit!