From b5af51b751cf33e39e4ade68c743a9594289a0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 23 Nov 2023 10:29:48 +0100 Subject: [PATCH] :bug: Fix propagation when adding a shape to a component --- common/src/app/common/files/changes.cljc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index 1c5d01e6ef..9df8792aca 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -770,6 +770,16 @@ (check-shape parent-id [parent-id]) shapes)))) +(defmethod components-changed :add-obj + [file-data {:keys [parent-id page-id _component-id] :as change}] + (when page-id + (let [page (ctpl/get-page file-data page-id) + parents (map (partial ctn/get-shape page) + (cons parent-id (cfh/get-parent-ids (:objects page) parent-id))) + xform (comp (filter :main-instance) + (map :component-id))] + (into #{} xform parents)))) + (defmethod components-changed :del-obj [file-data {:keys [id page-id _component-id] :as change}] (when page-id