|
@@ -1,21 +1,22 @@
|
|
|
(ns frontend.handler.file-sync
|
|
(ns frontend.handler.file-sync
|
|
|
"Provides util handler fns for file sync"
|
|
"Provides util handler fns for file sync"
|
|
|
(:require ["path" :as node-path]
|
|
(:require ["path" :as node-path]
|
|
|
|
|
+ [cljs-time.coerce :as tc]
|
|
|
|
|
+ [cljs-time.core :as t]
|
|
|
[cljs-time.format :as tf]
|
|
[cljs-time.format :as tf]
|
|
|
[cljs.core.async :as async :refer [go <!]]
|
|
[cljs.core.async :as async :refer [go <!]]
|
|
|
[cljs.core.async.interop :refer [p->c]]
|
|
[cljs.core.async.interop :refer [p->c]]
|
|
|
[clojure.string :as string]
|
|
[clojure.string :as string]
|
|
|
[frontend.config :as config]
|
|
[frontend.config :as config]
|
|
|
[frontend.db :as db]
|
|
[frontend.db :as db]
|
|
|
|
|
+ [frontend.fs :as fs]
|
|
|
[frontend.fs.sync :as sync]
|
|
[frontend.fs.sync :as sync]
|
|
|
[frontend.handler.notification :as notification]
|
|
[frontend.handler.notification :as notification]
|
|
|
- [frontend.state :as state]
|
|
|
|
|
[frontend.handler.user :as user]
|
|
[frontend.handler.user :as user]
|
|
|
- [frontend.fs :as fs]
|
|
|
|
|
[frontend.pubsub :as pubsub]
|
|
[frontend.pubsub :as pubsub]
|
|
|
- [cljs-time.coerce :as tc]
|
|
|
|
|
- [cljs-time.core :as t]
|
|
|
|
|
|
|
+ [frontend.state :as state]
|
|
|
[frontend.storage :as storage]
|
|
[frontend.storage :as storage]
|
|
|
|
|
+ [frontend.util :as util]
|
|
|
[lambdaisland.glogi :as log]
|
|
[lambdaisland.glogi :as log]
|
|
|
[logseq.common.path :as path]))
|
|
[logseq.common.path :as path]))
|
|
|
|
|
|
|
@@ -23,7 +24,6 @@
|
|
|
|
|
|
|
|
(def refresh-file-sync-component (atom false))
|
|
(def refresh-file-sync-component (atom false))
|
|
|
|
|
|
|
|
-
|
|
|
|
|
(defn get-current-graph-uuid []
|
|
(defn get-current-graph-uuid []
|
|
|
(state/get-current-file-sync-graph-uuid))
|
|
(state/get-current-file-sync-graph-uuid))
|
|
|
|
|
|
|
@@ -100,10 +100,12 @@
|
|
|
(defn load-session-graphs
|
|
(defn load-session-graphs
|
|
|
[]
|
|
[]
|
|
|
(when-not (state/sub [:file-sync/remote-graphs :loading])
|
|
(when-not (state/sub [:file-sync/remote-graphs :loading])
|
|
|
- (go (state/set-state! [:file-sync/remote-graphs :loading] true)
|
|
|
|
|
|
|
+ (go
|
|
|
|
|
+ (when-not util/web-platform?
|
|
|
|
|
+ (state/set-state! [:file-sync/remote-graphs :loading] true)
|
|
|
(let [graphs-or-exp (<! (<list-graphs))]
|
|
(let [graphs-or-exp (<! (<list-graphs))]
|
|
|
(when-not (instance? ExceptionInfo graphs-or-exp)
|
|
(when-not (instance? ExceptionInfo graphs-or-exp)
|
|
|
- (state/set-state! :file-sync/remote-graphs {:loading false :graphs graphs-or-exp}))))))
|
|
|
|
|
|
|
+ (state/set-state! :file-sync/remote-graphs {:loading false :graphs graphs-or-exp})))))))
|
|
|
|
|
|
|
|
(defn reset-session-graphs
|
|
(defn reset-session-graphs
|
|
|
[]
|
|
[]
|
|
@@ -181,7 +183,6 @@
|
|
|
>))]
|
|
>))]
|
|
|
all-version-list)))))
|
|
all-version-list)))))
|
|
|
|
|
|
|
|
-
|
|
|
|
|
(defn init-remote-graph
|
|
(defn init-remote-graph
|
|
|
[local-graph-dir graph]
|
|
[local-graph-dir graph]
|
|
|
(when (and local-graph-dir graph)
|
|
(when (and local-graph-dir graph)
|