diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index 1c5d01e6e..9df8792ac 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