0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

Merge pull request #2411 from penpot/hiru-bug-sync-undo

🐛 Fix component sync in undo
This commit is contained in:
Eva Marco 2022-10-10 17:23:46 +02:00 committed by GitHub
commit bcd9aa7ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -150,7 +150,8 @@
:hint-origin (ptk/type origin)
:changes redo-changes
:page-id page-id
:frames frames})
:frames frames
:save-undo? save-undo?})
ptk/UpdateEvent
(update [_ state]

View file

@ -842,11 +842,11 @@
check-changes
(fn [[event data]]
(let [changes (-> event deref :changes)
(let [{:keys [changes save-undo?]} (deref event)
components-changed (reduce #(into %1 (ch/components-changed data %2))
#{}
changes)]
(when (d/not-empty? components-changed)
(when (and (d/not-empty? components-changed) save-undo?)
(log/info :msg "DETECTED COMPONENTS CHANGED"
:ids (map str components-changed))
(run! st/emit!