Browse Source

Add current page and blocks count to rtc debug

Tienson Qin 2 years ago
parent
commit
d672146805
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/main/frontend/db/rtc/debug_ui.cljs

+ 5 - 1
src/main/frontend/db/rtc/debug_ui.cljs

@@ -13,6 +13,7 @@
             [frontend.state :as state]
             [frontend.ui :as ui]
             [frontend.util :as util]
+            [frontend.db :as db]
             [rum.core :as rum]))
 
 (defonce debug-state (atom nil))
@@ -108,7 +109,10 @@
            :local-tx @(::local-tx state)
            :pending-ops @(::ops state)
            :remote-graphs @(::remote-graphs state)
-           :auto-push-updates? @(::auto-push-updates? state)}
+           :auto-push-updates? @(::auto-push-updates? state)
+           :current-page (state/get-current-page)
+           :blocks-count (when-let [page (state/get-current-page)]
+                           (count (:block/_page (db/entity [:block/name (util/page-name-sanity-lc page)]))))}
           (fipp/pprint {:width 20})
           with-out-str)]
      (if (or (nil? s)