0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 16:30:37 -05:00

🐛 Fix propagation when adding a shape to a component

This commit is contained in:
Andrés Moya 2023-11-23 10:29:48 +01:00
parent 9f08e3b9e5
commit b5af51b751

View file

@ -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