mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 05:16:38 +02:00
🐛 Fix error when swapping a copy that is the only child of a group
This commit is contained in:
parent
2e3745099b
commit
1fa461e996
3 changed files with 7 additions and 1 deletions
|
@ -545,6 +545,7 @@
|
|||
(d/update-in-when [pid :shapes] d/without-obj sid)
|
||||
(d/update-in-when [pid :shapes] d/vec-without-nils)
|
||||
(cond-> component? (d/update-when pid #(dissoc % :remote-synced))))))))
|
||||
|
||||
(update-parent-id [objects id]
|
||||
(-> objects
|
||||
(d/update-when id assoc :parent-id parent-id)))
|
||||
|
|
|
@ -158,7 +158,11 @@
|
|||
|
||||
empty-parents
|
||||
;; Any parent whose children are all deleted, must be deleted too.
|
||||
(into (d/ordered-set) (find-all-empty-parents #{}))
|
||||
;; Unless we are during a component swap: in this case we are replacing a shape by
|
||||
;; other one, so must not delete empty parents.
|
||||
(if-not component-swap
|
||||
(into (d/ordered-set) (find-all-empty-parents #{}))
|
||||
#{})
|
||||
|
||||
components-to-delete
|
||||
(if components-v2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue