Browse Source

fix: nlp dates with #

fixes https://github.com/logseq/db-test/issues/121
Tienson Qin 1 year ago
parent
commit
29a250c669
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/main/frontend/components/editor.cljs

+ 6 - 4
src/main/frontend/components/editor.cljs

@@ -146,10 +146,12 @@
                        (set-matched-pages! result))))]
     (rum/use-effect! search-f [(mixins/use-debounce 50 q)])
     (let [matched-pages (if (string/blank? q)
-                          (->> (map (fn [title] {:block/title title
-                                                 :nlp-date? true})
-                                    date/nlp-pages)
-                               (take 10))
+                          (if db-tag?
+                            (db-model/get-all-classes (state/get-current-repo) {:except-root-class? true})
+                            (->> (map (fn [title] {:block/title title
+                                                  :nlp-date? true})
+                                     date/nlp-pages)
+                                (take 10)))
                           ;; reorder, shortest and starts-with first.
                           (let [matched-pages-with-new-page
                                 (fn [partial-matched-pages]