🐛 Fix undo on page relocate/sorting.

This commit is contained in:
Andrey Antukh 2021-11-24 12:37:55 +01:00 committed by Andrés Moya
parent c4947d3737
commit e7b4010eba
9 changed files with 89 additions and 33 deletions

View file

@ -114,20 +114,20 @@
:changes changes}))))
(defn commit-changes
[{:keys [redo-changes undo-changes origin save-undo? file-id]
:or {save-undo? true}}]
[{:keys [redo-changes undo-changes origin save-undo? file-id] :or {save-undo? true}}]
(log/debug :msg "commit-changes"
:js/redo-changes redo-changes
:js/undo-changes undo-changes)
(let [error (volatile! nil)
strace (.-stack (ex-info "" {}))]
(let [error (volatile! nil)]
(ptk/reify ::commit-changes
cljs.core/IDeref
(-deref [_]
{:file-id file-id
:hint-events @st/last-events
:hint-origin (ptk/type origin)
:hint-strace strace
:changes redo-changes})
ptk/UpdateEvent
@ -135,7 +135,6 @@
(let [current-file-id (get state :current-file-id)
file-id (or file-id current-file-id)
path (if (= file-id current-file-id)
[:workspace-data]
[:workspace-libraries file-id :data])]
(try