0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

🐛 Fix validation error on duplicating a component with nested copies

This commit is contained in:
Andrés Moya 2023-11-28 12:04:36 +01:00
parent ffd36df0e1
commit 1a146dbab7

View file

@ -20,6 +20,7 @@
[app.common.types.container :as ctn]
[app.common.types.file :as ctf]
[app.common.types.page :as ctp]
[app.common.types.shape-tree :as ctst]
[app.common.types.shape.interactions :as ctsi]
[app.common.types.shape.layout :as ctl]
[app.common.uuid :as uuid]
@ -494,11 +495,20 @@
changes (cond-> changes
(and is-component-root? is-component-main?)
(regenerate-component new-obj))]
(regenerate-component new-obj))
; This is needed for the recursive call to find the new object as parent
page' (ctst/add-shape (:id new-obj)
new-obj
{:objects objects}
(:frame-id new-obj)
(:parent-id new-obj)
nil
true)]
(reduce (fn [changes child]
(prepare-duplicate-shape-change changes
objects
(:objects page')
page
unames
update-unames!