Skip to content

Commit 0fe1715

Browse files
committed
fix(regression): (()) doesn't work for blocks in file graph
fixes https://test.logseq.com/#/page/690b64e4-a0aa-4619-a97f-c9a37d80b2a6
1 parent 0046fff commit 0fe1715

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/frontend/components/editor.cljs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@
328328
state)}
329329
[state _edit-block input id q format selected-text]
330330
(let [result (->> (rum/react (get state ::result))
331-
(remove (fn [b] (or (nil? (:block/uuid b))
332-
(string/blank? (:block/title (db-model/query-block-by-uuid (:block/uuid b))))))))
331+
(remove (fn [b] (nil? (:block/uuid b)))))
333332
db? (config/db-based-graph? (state/get-current-repo))
334333
embed? (and db? (= @commands/*current-command "Block embed"))
335334
chosen-handler (block-on-chosen-handler embed? input id q format selected-text)
@@ -339,14 +338,12 @@
339338
{:on-chosen chosen-handler
340339
:on-enter non-exist-block-handler
341340
:empty-placeholder [:div.text-gray-500.text-sm.px-4.py-2 (t :editor/block-search)]
342-
:item-render (fn [{:block/keys [page uuid]}] ;; content returned from search engine is normalized
341+
:item-render (fn [{:block/keys [page uuid title]}]
343342
(let [page-entity (db/entity [:block/uuid page])
344343
repo (state/sub :git/current-repo)
345-
format (get page-entity :block/format :markdown)
346-
block (db-model/get-block-by-uuid uuid)
347-
content (:block/title block)]
348-
(when-not (string/blank? content)
349-
[:.py-2 (search/block-search-result-item repo uuid format content q :block)])))
344+
format (get page-entity :block/format :markdown)]
345+
(when-not (string/blank? title)
346+
[:.py-2 (search/block-search-result-item repo uuid format title q :block)])))
350347
:class "ac-block-search"})))
351348

352349
(rum/defcs block-search < rum/reactive

0 commit comments

Comments
 (0)