Merge pull request #2214 from penpot/palba-fix-undo-delete-page

🐛 Fix undo on delete page does not preserve its order
This commit is contained in:
Alejandro 2022-09-01 08:16:11 +02:00 committed by GitHub
commit ee1058950e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 8 deletions

View file

@ -326,7 +326,10 @@
(ptk/reify ::delete-page
ptk/WatchEvent
(watch [it state _]
(let [page (get-in state [:workspace-data :pages-index id])
(let [pages (get-in state [:workspace-data :pages])
index (d/index-of pages id)
page (get-in state [:workspace-data :pages-index id])
page (assoc page :index index)
changes (-> (pcb/empty-changes it)
(pcb/del-page page))]