0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

🐛 Fix problem with undo

This commit is contained in:
alonso.torres 2021-05-10 16:48:26 +02:00
parent 4405bd95f9
commit 4118e53d7d

View file

@ -69,6 +69,7 @@
(watch [_ state stream]
(let [page-id (:current-page-id state)
objects (get-in state [:workspace-data :pages-index page-id :objects])
objects' (get-in state [:workspace-file :data :pages-index page-id :objects])
reg-objects {:type :reg-objects :page-id page-id :shapes (vec ids)}]
(loop [ids (seq ids)
rch []
@ -84,8 +85,9 @@
(let [id (first ids)
obj1 (get objects id)
obj2 (f obj1)
obj3 (get objects' id)
rch-operations (generate-operations obj1 obj2)
uch-operations (generate-operations obj2 obj1 true)
uch-operations (generate-operations obj2 obj3 true)
rchg {:type :mod-obj
:page-id page-id
:operations rch-operations