diff --git a/deps/db/src/logseq/db/frontend/property.cljs b/deps/db/src/logseq/db/frontend/property.cljs index 0da237975..085f7df0e 100644 --- a/deps/db/src/logseq/db/frontend/property.cljs +++ b/deps/db/src/logseq/db/frontend/property.cljs @@ -265,14 +265,11 @@ "Get the value of built-in block's property by its db-ident" [repo db block db-ident] (when db - (let [block (or (d/entity db (:db/id block)) block) - ;; FIXME: Use db-based-graph? when this fn moves to another ns - properties' (if (and (string/starts-with? repo "logseq_db_") - ;; FIXME: Find a way to do this nbb check without affecting frontend - (not (:block/raw-properties block))) - (properties block) - (:block/properties block))] - (lookup repo properties' db-ident)))) + (let [block (or (d/entity db (:db/id block)) block)] + ;; FIXME: Use db-based-graph? when this fn moves to another ns + (if (string/starts-with? repo "logseq_db_") + (get (get-pair-e block db-ident) db-ident) + (lookup repo (:block/properties block) db-ident))))) (defn shape-block? [repo db block] diff --git a/src/main/frontend/components/editor.cljs b/src/main/frontend/components/editor.cljs index b6bd59eec..dadbe103e 100644 --- a/src/main/frontend/components/editor.cljs +++ b/src/main/frontend/components/editor.cljs @@ -583,8 +583,7 @@ "Get textarea css class according to it's content" [block content format] (let [content (if content (str content) "") - properties (:block/properties block) - heading (pu/lookup properties :logseq.property/heading) + heading (pu/get-block-property-value block :logseq.property/heading) heading (if (true? heading) (min (inc (:block/level block)) 6) heading)] diff --git a/src/main/frontend/components/right_sidebar.cljs b/src/main/frontend/components/right_sidebar.cljs index a7e983ad9..f53b3d422 100644 --- a/src/main/frontend/components/right_sidebar.cljs +++ b/src/main/frontend/components/right_sidebar.cljs @@ -20,7 +20,8 @@ [medley.core :as medley] [reitit.frontend.easy :as rfe] [rum.core :as rum] - [frontend.db.rtc.debug-ui :as rtc-debug-ui])) + [frontend.db.rtc.debug-ui :as rtc-debug-ui] + [frontend.handler.property.util :as pu])) (rum/defc toggle [] @@ -98,7 +99,7 @@ page (db/entity repo lookup) page-name (:block/name page)] [[:.flex.items-center.page-title - (if-let [icon (get-in page [:block/properties :icon])] + (if-let [icon (pu/get-block-property-value page :logseq.property/icon)] [:.text-md.mr-2 icon] (ui/icon (if (= "whiteboard" (:block/type page)) "whiteboard" "page") {:class "text-md mr-2"})) [:span.overflow-hidden.text-ellipsis (:block/original-name page)]] diff --git a/src/main/frontend/db/model.cljs b/src/main/frontend/db/model.cljs index 889c51db4..e180fcc68 100644 --- a/src/main/frontend/db/model.cljs +++ b/src/main/frontend/db/model.cljs @@ -367,7 +367,7 @@ independent of format as format specific heading characters are stripped" (defn get-block-parents-v2 [repo block-id] (d/pull (conn/get-db repo) - '[:db/id :block/collapsed? :block/properties {:block/parent ...}] + '[:db/id :block/collapsed? {:block/parent ...}] [:block/uuid block-id])) (def get-block-last-direct-child-id ldb/get-block-last-direct-child-id)