mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: 'Replace graph' command not working
This commit is contained in:
@@ -85,7 +85,7 @@
|
||||
|
||||
(defn import-chosen-graph
|
||||
[repo]
|
||||
(p/let [_ (persist-db/<unsafe-delete repo)]
|
||||
(p/let [_ (persist-db/<close-db repo)]
|
||||
(notification/show! (str "Graph updated! Switching to graph ...") :success)
|
||||
(state/pub-event! [:graph/switch repo])))
|
||||
|
||||
|
||||
@@ -88,6 +88,13 @@
|
||||
(protocol/<unsafe-delete client repo))
|
||||
(protocol/<unsafe-delete (get-impl) repo))))
|
||||
|
||||
(defn <close-db [repo]
|
||||
(when repo
|
||||
(if (electron-runtime?)
|
||||
(p/let [remote-client (<ensure-remote! repo)]
|
||||
(remote/invoke! (:client remote-client) "thread-api/close-db" false [repo]))
|
||||
(state/<invoke-db-worker :thread-api/close-db repo))))
|
||||
|
||||
(defn <export-db
|
||||
[repo opts]
|
||||
(when repo
|
||||
|
||||
@@ -658,6 +658,11 @@
|
||||
_result (remove-vfs! pool)]
|
||||
nil))
|
||||
|
||||
(def-thread-api :thread-api/close-db
|
||||
[repo]
|
||||
(close-db! repo)
|
||||
nil)
|
||||
|
||||
(defn- import-datoms-to-db!
|
||||
[repo graph-id remote-tx datoms]
|
||||
(->
|
||||
|
||||
Reference in New Issue
Block a user