Browse Source

fix: search prompts empty results

Tienson Qin 4 năm trước cách đây
mục cha
commit
cbe815496c
1 tập tin đã thay đổi với 8 bổ sung5 xóa
  1. 8 5
      src/main/frontend/db/model.cljs

+ 8 - 5
src/main/frontend/db/model.cljs

@@ -1117,11 +1117,14 @@
          (map :v)
          (map (fn [id]
                 (let [e (db-utils/entity [:block/uuid id])]
-                  {:db/id (:db/id e)
-                   :block/uuid id
-                   :block/page (:db/id (:block/page e))
-                   :block/content (:block/content e)
-                   :block/format (:block/format e)}))))))
+                  (when (and (not (:block/name e))
+                             (not (string/blank? (:block/content e))))
+                    {:db/id (:db/id e)
+                     :block/uuid id
+                     :block/page (:db/id (:block/page e))
+                     :block/content (:block/content e)
+                     :block/format (:block/format e)}))))
+         (remove nil?))))
 
 (defn get-assets
   [datoms]