fix: breadcrumb not showing if a block hasn't been fetched from

db worker.
pull/11514/head
Tienson Qin 2024-09-10 17:35:20 +08:00
parent 7b18a9e055
commit d54c87629c
2 changed files with 4 additions and 2 deletions

View File

@ -2786,7 +2786,9 @@
(let [args (:rum/args state) (let [args (:rum/args state)
block-id (nth args 2) block-id (nth args 2)
depth (:level-limit (last args))] depth (:level-limit (last args))]
(p/let [id (:db/id (db/entity [:block/uuid block-id]))] (p/let [id (:db/id (db/entity [:block/uuid block-id]))
_block (db-async/<get-block (state/get-current-repo) block-id
{:children? false})]
(when id (db-async/<get-block-parents (state/get-current-repo) id depth))) (when id (db-async/<get-block-parents (state/get-current-repo) id depth)))
state))} state))}
[config repo block-id {:keys [show-page? indent? end-separator? level-limit _navigating-block] [config repo block-id {:keys [show-page? indent? end-separator? level-limit _navigating-block]

View File

@ -246,7 +246,7 @@
{:icon icon {:icon icon
:icon-theme :gray :icon-theme :gray
:text (highlight-content-query text @!input) :text (highlight-content-query text @!input)
:header (when-not (ldb/object? block) (block/breadcrumb {:search? true} repo id {})) :header (when-not (db/page? block) (block/breadcrumb {:search? true} repo id {}))
:current-page? (when-let [page-id (:block/page block)] :current-page? (when-let [page-id (:block/page block)]
(= page-id (:block/uuid current-page))) (= page-id (:block/uuid current-page)))
:source-block block})) :source-block block}))