enhance(sync): align db-sync/undo tests and lint

This commit is contained in:
Tienson Qin
2026-03-21 18:46:35 +08:00
parent 8539db5015
commit f7a7391196
21 changed files with 1392 additions and 209 deletions

View File

@@ -3,7 +3,6 @@
[frontend.db :as db]
[frontend.handler.editor :as editor-handler]
[frontend.state :as state]
[frontend.undo-redo :as undo-redo]
[frontend.util :as util]
[goog.dom :as gdom]))
@@ -30,9 +29,12 @@
;; skip recording editor info when undo or redo is still running
(when-not (contains? #{:undo :redo} @(:editor/op @state/state))
(let [page-id (:block/uuid (:block/page (db/entity (:db/id (state/get-edit-block)))))
repo (state/get-current-repo)]
repo (state/get-current-repo)
editor-info (state/get-editor-info)]
(when page-id
(undo-redo/record-editor-info! repo (state/get-editor-info)))))
(state/<invoke-db-worker :thread-api/undo-redo-record-editor-info
repo
editor-info))))
(state/set-state! :editor/op nil))
state)