fix: blocks indice wasn't built after downloading a remote graph

fixes LOG-3117
pull/11055/head
Tienson Qin 2024-03-21 14:11:48 +08:00
parent f814216042
commit afd9bd14da
2 changed files with 7 additions and 6 deletions

View File

@ -187,11 +187,13 @@
;; Parameters for the `persist-db` function, to show the notification messages
(defn- graph-switch-on-persisted
"graph: the target graph to switch to"
[graph _opts]
[graph opts]
(p/do!
(repo-handler/restore-and-setup-repo! graph)
(graph-switch graph)
(state/set-state! :sync-graph/init? false)))
(repo-handler/restore-and-setup-repo! graph)
(graph-switch graph)
(state/set-state! :sync-graph/init? false)
(when (:rtc-download? opts)
(and (search-handler/rebuild-indices!) true))))
(defmethod handle :graph/switch [[_ graph opts]]
(state/set-state! :db/async-queries #{})

View File

@ -5,7 +5,6 @@
[frontend.handler.notification :as notification]
[frontend.state :as state]
[promesa.core :as p]
[frontend.util :as util]
[logseq.db :as ldb]))
(defmulti handle identity)
@ -28,7 +27,7 @@
(defmethod handle :add-repo [_ _worker data]
(state/add-repo! {:url (:repo data)})
(state/pub-event! [:graph/switch (:repo data) {}]))
(state/pub-event! [:graph/switch (:repo data) {:rtc-download? true}]))
(defmethod handle :rtc-sync-state [_ _worker data]
(let [state data]