Browse Source

fix: delay building search indice

Tienson Qin 4 weeks ago
parent
commit
d7b4d61e19
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/main/frontend/handler/events.cljs

+ 5 - 2
src/main/frontend/handler/events.cljs

@@ -76,8 +76,11 @@
    (graph-switch graph)
    (state/set-state! :sync-graph/init? false)
    (when (:rtc-download? opts)
-     (and (search-handler/rebuild-indices!) true)
-     (repo-handler/refresh-repos!))))
+     (repo-handler/refresh-repos!)
+     (p/do!
+      (p/delay 5000)
+      ;; TODO: search should be lazy computed
+      (search-handler/rebuild-indices!)))))
 
 (defmethod handle :graph/switch [[_ graph opts]]
   (let [switch-promise