mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: <sync-start returns a channel
This commit is contained in:
@@ -132,7 +132,7 @@
|
||||
(do
|
||||
(state/set-state! [:ui/loading? :graph/create-remote?] true)
|
||||
(when-let [GraphUUID (get (async/<! (file-sync-handler/create-graph graph-name)) 2)]
|
||||
(async/<! (fs-sync/sync-start))
|
||||
(async/<! (fs-sync/<sync-start))
|
||||
(state/set-state! [:ui/loading? :graph/create-remote?] false)
|
||||
;; update existing repo
|
||||
(state/set-repos! (map (fn [r]
|
||||
@@ -376,7 +376,7 @@
|
||||
(second @graphs-txid)
|
||||
(fs-sync/graph-sync-off? (second @graphs-txid))
|
||||
(async/<! (fs-sync/<check-remote-graph-exists (second @graphs-txid))))
|
||||
(fs-sync/sync-start)
|
||||
(fs-sync/<sync-start)
|
||||
|
||||
;; remote graph already has been deleted, clear repos first, then create-remote-graph
|
||||
synced-file-graph? ; <check-remote-graph-exists -> false
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
(display-welcome-message)
|
||||
(persist-var/load-vars)
|
||||
(when config/dev?
|
||||
(js/setTimeout #(sync/sync-start) 1000))))
|
||||
(js/setTimeout #(sync/<sync-start) 1000))))
|
||||
|
||||
(defn ^:export init []
|
||||
;; init is called ONCE when the page loads
|
||||
|
||||
@@ -3000,11 +3000,11 @@
|
||||
|
||||
(declare network-online-cursor)
|
||||
|
||||
(defn sync-start
|
||||
(defn <sync-start
|
||||
[]
|
||||
(when (false? @*sync-entered?)
|
||||
(reset! *sync-entered? true)
|
||||
(go
|
||||
(go
|
||||
(when (false? @*sync-entered?)
|
||||
(reset! *sync-entered? true)
|
||||
(let [*sync-state (atom (sync-state))
|
||||
current-user-uuid (user/user-uuid)
|
||||
;; put @graph-uuid & get-current-repo together,
|
||||
@@ -3056,7 +3056,7 @@
|
||||
(<sync-stop)
|
||||
|
||||
(and (false? o) (true? n))
|
||||
(sync-start)
|
||||
(<sync-start)
|
||||
|
||||
:else
|
||||
nil)))
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
(defn- file-sync-restart! []
|
||||
(async/go (async/<! (p->c (persist-var/load-vars)))
|
||||
(async/<! (sync/<sync-stop))
|
||||
(some-> (sync/sync-start) async/<!)))
|
||||
(some-> (sync/<sync-start) async/<!)))
|
||||
|
||||
(defn- file-sync-stop! []
|
||||
(async/go (async/<! (p->c (persist-var/load-vars)))
|
||||
@@ -93,7 +93,7 @@
|
||||
(vector? (:sync-meta %))
|
||||
(util/uuid-string? (first (:sync-meta %)))
|
||||
(util/uuid-string? (second (:sync-meta %)))) repos)
|
||||
(sync/sync-start)))))
|
||||
(sync/<sync-start)))))
|
||||
(ui-handler/re-render-root!)
|
||||
(file-sync/maybe-onboarding-show status)))))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user