mirror of
https://github.com/penpot/penpot.git
synced 2025-05-28 16:16:13 +02:00
🐛 Fix bad page-id on undo delete component
This commit is contained in:
parent
3620e6b4d7
commit
be31371892
5 changed files with 10 additions and 7 deletions
|
@ -551,7 +551,7 @@
|
|||
(map :component-id))
|
||||
|
||||
changes (reduce (fn [changes component-id]
|
||||
(pcb/delete-component changes component-id))
|
||||
(pcb/delete-component changes component-id (:id page)))
|
||||
changes
|
||||
components-to-delete)]
|
||||
changes))
|
||||
|
|
|
@ -483,9 +483,10 @@
|
|||
(rx/of
|
||||
(dwt/clear-thumbnail (:current-file-id state) page-id root-id "component")
|
||||
(dwsh/delete-shapes page-id #{root-id}))) ;; Deleting main root triggers component delete
|
||||
(let [changes (-> (pcb/empty-changes it)
|
||||
(let [page-id (:current-page-id state)
|
||||
changes (-> (pcb/empty-changes it)
|
||||
(pcb/with-library-data data)
|
||||
(pcb/delete-component id))]
|
||||
(pcb/delete-component id page-id))]
|
||||
(rx/of (dch/commit-changes changes))))))))
|
||||
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@
|
|||
changes (reduce (fn [changes component-id]
|
||||
;; It's important to delete the component before the main instance, because we
|
||||
;; need to store the instance position if we want to restore it later.
|
||||
(pcb/delete-component changes component-id))
|
||||
(pcb/delete-component changes component-id (:id page)))
|
||||
changes
|
||||
components-to-delete)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue