From b17371d44093172b30b9d63cbd4988749dcf9c3b Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 27 Feb 2024 13:57:16 +0100 Subject: [PATCH] :bug: Fix problems on sync with components chain with reset override --- frontend/src/app/main/data/workspace/libraries_helpers.cljs | 3 ++- frontend/test/frontend_tests/state_components_sync_test.cljs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index 84b429de4..b5fe53a7b 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -606,7 +606,8 @@ shape-main (when component (if (and reset? components-v2) - (ctf/find-remote-shape container libraries shape-inst) + ;; the reset is against the ref-shape, not against the original shape of the component + (ctf/find-ref-shape nil container libraries shape-inst {:include-deleted? true}) (ctf/get-ref-shape library component shape-inst))) shape-inst (if (and reset? components-v2) diff --git a/frontend/test/frontend_tests/state_components_sync_test.cljs b/frontend/test/frontend_tests/state_components_sync_test.cljs index 7e74291f8..1751fe9a5 100644 --- a/frontend/test/frontend_tests/state_components_sync_test.cljs +++ b/frontend/test/frontend_tests/state_components_sync_test.cljs @@ -1177,8 +1177,8 @@ (t/is (= (:fill-opacity shape1) 0)) (t/is (= (:name shape2) "Rect 1")) (t/is (= (:touched shape2) nil)) - (t/is (= (:fill-color shape2) clr/white)) - (t/is (= (:fill-opacity shape2) 1)) + (t/is (= (:fill-color shape2) clr/test)) + (t/is (= (:fill-opacity shape2) 0.5)) (t/is (= (:name c-instance2) "Board")) (t/is (= (:touched c-instance2) nil))