Browse Source

enhance(ux): disable journal blocks virtualize to improve scroll

Tienson Qin 3 months ago
parent
commit
2c47b92675
2 changed files with 5 additions and 1 deletions
  1. 1 0
      src/main/frontend/components/block.cljs
  2. 4 1
      src/main/mobile/components/modal.cljs

+ 1 - 0
src/main/frontend/components/block.cljs

@@ -4391,6 +4391,7 @@
 (rum/defc block-list
   [config blocks]
   (let [[virtualized? _] (rum/use-state (not (or (and (:journals? config) (< (count blocks) 50))
+                                                 (and (util/mobile?) (ldb/journal? (:block/page (first blocks))))
                                                  (:block-children? config))))
         render-item (fn [idx]
                       (let [top? (zero? idx)

+ 4 - 1
src/main/mobile/components/modal.cljs

@@ -7,6 +7,7 @@
             [frontend.handler.page :as page-handler]
             [frontend.state :as state]
             [frontend.ui :as ui]
+            [logseq.db :as ldb]
             [mobile.components.ui :as mobile-ui]
             [mobile.init :as init]
             [mobile.ionic :as ion]
@@ -47,7 +48,9 @@
                          (ui/menu-link
                           {:on-click (fn []
                                        (mobile-ui/open-modal!
-                                        "⚠️ Are you sure you want to delete this page(block)?"
+                                        (str "⚠️ Are you sure you want to delete this "
+                                             (if (ldb/page? block) "page" "block")
+                                             "?")
                                         {:type :alert
                                          :on-action (fn [{:keys [role]}]
                                                       (when (not= role "cancel")