fix(sync): check user refresh-token as well

This commit is contained in:
Andelf
2023-09-07 20:06:52 +08:00
parent 70cb124e8b
commit 0e4e42ac2b
2 changed files with 7 additions and 1 deletions

View File

@@ -3509,7 +3509,8 @@
(go-loop []
(<! (timeout 60000))
(when (and (state/enable-sync?)
@network-online-cursor ; is online
@network-online-cursor ;; is online
(user/has-refresh-token?) ;; has refresh token, user should be logged in
(or (= ::stop (:state (state/get-file-sync-state))) ;; state=stopped
(nil? (state/get-file-sync-state)))) ;; the whole sync state not inited yet, happens when app starts without network
(println "trying to restart sync..." (tc/to-string (t/now)))