🐛 Fix undo on delete page does not preserve its order

This commit is contained in:
Pablo Alba 2022-08-31 18:37:35 +02:00
parent 469704def6
commit be656bb4ef
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))]