mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 00:40:30 -05:00
🐛 Fix propagation when adding a shape to a component
This commit is contained in:
parent
9f08e3b9e5
commit
b5af51b751
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue