Skip to content

Commit 3afb112

Browse files
committed
fix: search prioritizes creating page over existing library item
fixes logseq/db-test#563
1 parent 1fca2a9 commit 3afb112

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/frontend/components/cmdk/core.cljs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,8 @@
129129
(when-not (string/blank? input)
130130
(some (fn [block]
131131
(and
132-
(:block/tags block)
133-
(not (:block/parent block))
134-
(= input (util/page-name-sanity-lc (:block/title block))))) blocks-result)))
132+
(:page? block)
133+
(= input (util/page-name-sanity-lc (:block.temp/original-title block))))) blocks-result)))
135134
include-slash? (or (string/includes? input "/")
136135
(string/starts-with? input "/"))
137136
start-with-slash? (string/starts-with? input "/")

src/main/frontend/worker/search.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ DROP TRIGGER IF EXISTS blocks_au;
426426
:block/title (if (ldb/page? block)
427427
(ldb/get-title-with-parents block)
428428
(or snippet title))
429+
:block.temp/original-title (:block/title block)
429430
:block/page (or
430431
(:block/uuid (:block/page block))
431432
(when page

0 commit comments

Comments
 (0)