diff --git a/src/main/frontend/components/right_sidebar.cljs b/src/main/frontend/components/right_sidebar.cljs index 251ccd567..9d57b0ac4 100644 --- a/src/main/frontend/components/right_sidebar.cljs +++ b/src/main/frontend/components/right_sidebar.cljs @@ -18,7 +18,6 @@ [frontend.ui :as ui] [logseq.shui.ui :as shui] [frontend.util :as util] - [frontend.config :as config] [medley.core :as medley] [reitit.frontend.easy :as rfe] [rum.core :as rum] @@ -104,17 +103,6 @@ {:default-collapsed? true})]) stack) {:default-collapsed? true})])) -(rum/defc history < rum/reactive - [] - ;; (let [state (undo-redo/get-state) - ;; page-only-mode? (state/sub :history/page-only-mode?)] - ;; [:div.ml-4 - ;; [:div.ml-3.font-bold (if page-only-mode? (t :right-side-bar/history-pageonly) (t :right-side-bar/history-global))] - ;; [:div.p-4 [:.ml-4.mb-2 - ;; (history-stack (t :right-side-bar/history-undos) (rum/react (:undo-stack state))) - ;; (history-stack (t :right-side-bar/history-redos) (rum/react (:redo-stack state)))]]]) - ) - (defn build-sidebar-item [repo idx db-id block-type *db-id init-key] (case (keyword block-type) diff --git a/src/main/frontend/config.cljs b/src/main/frontend/config.cljs index 16874844a..8ccb4bd63 100644 --- a/src/main/frontend/config.cljs +++ b/src/main/frontend/config.cljs @@ -25,8 +25,9 @@ (reset! state/publishing? publishing?) -(goog-define TEST false) -(def test? TEST) +(comment + (goog-define TEST false) + (def test? TEST)) (def ENABLE-FILE-SYNC-PRODUCTION false) diff --git a/src/main/frontend/handler/history.cljs b/src/main/frontend/handler/history.cljs index 5fc64494d..e61a187c9 100644 --- a/src/main/frontend/handler/history.cljs +++ b/src/main/frontend/handler/history.cljs @@ -5,6 +5,7 @@ [frontend.handler.route :as route-handler] [frontend.state :as state] [frontend.util :as util] + [frontend.util.page :as page-util] [goog.dom :as gdom] [promesa.core :as p])) @@ -40,11 +41,7 @@ (defn undo! [e] (when-let [repo (state/get-current-repo)] - ;; TODO: - ;; 1. :block/name will be non-unique, switch to other way to get current-page-uuid - ;; 2. (state/get-current-page) return wrong result when editing in right-sidebar - (when-let [current-page-uuid-str (some->> (state/get-current-page) - (vector :block/name) + (when-let [current-page-uuid-str (some->> (page-util/get-editing-page-id) db/entity :block/uuid str)] @@ -61,8 +58,7 @@ (defn redo! [e] (when-let [repo (state/get-current-repo)] - (when-let [current-page-uuid-str (some->> (state/get-current-page) - (vector :block/name) + (when-let [current-page-uuid-str (some->> (page-util/get-editing-page-id) db/entity :block/uuid str)] diff --git a/src/main/frontend/modules/outliner/pipeline.cljs b/src/main/frontend/modules/outliner/pipeline.cljs index 58ef57e48..a93fa1515 100644 --- a/src/main/frontend/modules/outliner/pipeline.cljs +++ b/src/main/frontend/modules/outliner/pipeline.cljs @@ -25,12 +25,12 @@ (history/restore-app-state! app-state)) (defn invoke-hooks - [{:keys [_request-id tx-meta tx-data deleted-block-uuids affected-keys blocks] :as opts}] + [{:keys [_request-id tx-meta tx-data deleted-block-uuids affected-keys blocks]}] ;; (prn :debug ;; :request-id request-id ;; :tx-meta tx-meta ;; :tx-data tx-data) - (let [{:keys [from-disk? new-graph? local-tx? undo? redo? initial-pages? end?]} tx-meta + (let [{:keys [from-disk? new-graph? undo? redo? initial-pages? end?]} tx-meta repo (state/get-current-repo) tx-report {:tx-meta tx-meta :tx-data tx-data}