diff --git a/deps/outliner/src/logseq/outliner/op/construct.cljc b/deps/outliner/src/logseq/outliner/op/construct.cljc index 5c12561c42..29616ebe74 100644 --- a/deps/outliner/src/logseq/outliner/op/construct.cljc +++ b/deps/outliner/src/logseq/outliner/op/construct.cljc @@ -938,8 +938,7 @@ (log/error ::invalid-outliner-ops {:tx-meta tx-meta :forward-outliner-ops forward-outliner-ops :inverse-outliner-ops inverse-outliner-ops}) - (throw (ex-info "Invalid outliner-ops" - {:tx-meta tx-meta}))) + (throw (ex-info "Invalid outliner-ops" {:tx-meta tx-meta}))) ;; (pprint/pprint ;; {:forward-outliner-ops forward-outliner-ops ;; :inverse-outliner-ops inverse-outliner-ops}) diff --git a/src/main/frontend/undo_redo.cljs b/src/main/frontend/undo_redo.cljs index be987e41c4..e404b20e53 100644 --- a/src/main/frontend/undo_redo.cljs +++ b/src/main/frontend/undo_redo.cljs @@ -1,8 +1,7 @@ (ns frontend.undo-redo "Main-thread proxy for worker-owned undo/redo." (:require [frontend.state :as state] - [frontend.util :as util] - [frontend.worker.undo-redo :as worker-undo-redo])) + [frontend.util :as util])) (defn- worker-not-initialized? [e] @@ -19,82 +18,52 @@ result)) +(defn- invoke-db-worker + [thread-api & args] + (try + (apply state/ (invoke-db-worker :thread-api/undo-redo-undo repo) + normalize-empty-result) + :frontend.undo-redo/empty-undo-stack))) (defn redo [repo] (if util/node-test? - (normalize-empty-result (worker-undo-redo/redo repo)) - (try - (state/ (invoke-db-worker :thread-api/undo-redo-redo repo) + normalize-empty-result) + :frontend.undo-redo/empty-redo-stack))) (defn record-editor-info! [repo editor-info] (when editor-info (if util/node-test? - (do - (worker-undo-redo/record-editor-info! repo editor-info) - nil) - (try - (state/