Skip to content

Commit

Permalink
fix: sync works but uploading/downloading files are not shown
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin authored and andelf committed Sep 15, 2022
1 parent ed071cb commit 40221d4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/main/frontend/fs/sync.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
[frontend.fs :as fs]
[frontend.encrypt :as encrypt]
[medley.core :refer [dedupe-by]]
[rum.core :as rum]))
[rum.core :as rum]
[promesa.core :as p]))

;;; ### Commentary
;; file-sync related local files/dirs:
Expand Down Expand Up @@ -181,8 +182,8 @@
[latest-txid graph-uuid user-uuid repo]
{:pre [(int? latest-txid) (>= latest-txid 0)]}
(persist-var/-reset-value! graphs-txid [user-uuid graph-uuid latest-txid] repo)
(some-> (persist-var/persist-save graphs-txid)
p->c)
(p/let [_ (persist-var/persist-save graphs-txid)]
(state/pub-event! [:graph/refresh]))
(when (state/developer-mode?) (assert-local-txid<=remote-txid)))

(defn clear-graphs-txid! [repo]
Expand Down
3 changes: 3 additions & 0 deletions src/main/frontend/handler/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@
(repo-handler/refresh-repos!)
(file-sync-restart!))

(defmethod handle :graph/refresh [_]
(repo-handler/refresh-repos!))

(defn- graph-switch
([graph]
(graph-switch graph false))
Expand Down
9 changes: 6 additions & 3 deletions src/main/frontend/handler/repo.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,12 @@

(defn refresh-repos!
[]
(p/let [repos (get-repos)]
(state/set-repos! repos)
repos))
(p/let [repos (get-repos)
repos' (combine-local-&-remote-graphs
repos
(state/get-remote-repos))]
(state/set-repos! repos')
repos'))

(defn graph-ready!
"Call electron that the graph is loaded."
Expand Down

0 comments on commit 40221d4

Please sign in to comment.