mirror of
https://github.com/logseq/logseq.git
synced 2026-05-22 11:44:10 +00:00
fix: don't show file graphs on both web and mobile
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
|
||||
(defn get-all-graphs
|
||||
[]
|
||||
(p/let [idb-repos (idb/get-nfs-dbs)
|
||||
(p/let [idb-repos (when-not (or (util/web-platform?) (util/mobile?))
|
||||
(idb/get-nfs-dbs))
|
||||
repos (persist-db/<list-db)
|
||||
repos' (map
|
||||
(fn [{:keys [name] :as repo}]
|
||||
|
||||
@@ -3213,7 +3213,7 @@
|
||||
(defn <sync-start
|
||||
[]
|
||||
(go
|
||||
(when-not @*sync-starting
|
||||
(when-not (or @*sync-starting (util/mobile?) (util/web-platform?))
|
||||
(reset! *sync-starting true)
|
||||
(if-not (and (<! (<should-start-sync?))
|
||||
(<! (<connectivity-testing)))
|
||||
|
||||
@@ -317,7 +317,8 @@
|
||||
(defmethod events/handle :user/fetch-info-and-graphs [[_]]
|
||||
(state/set-state! [:ui/loading? :login] false)
|
||||
(async/go
|
||||
(let [result (async/<! (sync/<user-info sync/remoteapi))]
|
||||
(let [result (async/<! (sync/<user-info sync/remoteapi))
|
||||
mobile-or-web? (or (util/mobile?) (util/web-platform?))]
|
||||
(cond
|
||||
(instance? ExceptionInfo result)
|
||||
nil
|
||||
@@ -330,15 +331,18 @@
|
||||
(when (and (= status :welcome) (user-handler/logged-in?))
|
||||
(enable-beta-features!)
|
||||
(async/<! (p->c (rtc-handler/<get-remote-graphs)))
|
||||
(async/<! (file-sync-handler/load-session-graphs))
|
||||
(when-not mobile-or-web?
|
||||
(async/<! (file-sync-handler/load-session-graphs)))
|
||||
(p/let [repos (repo-handler/refresh-repos!)]
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
(when (some #(and (= (:url %) repo)
|
||||
(vector? (:sync-meta %))
|
||||
(util/uuid-string? (first (:sync-meta %)))
|
||||
(util/uuid-string? (second (:sync-meta %)))) repos)
|
||||
(sync/<sync-start)))))
|
||||
(file-sync/maybe-onboarding-show status)))))))
|
||||
(when-not mobile-or-web?
|
||||
(when (some #(and (= (:url %) repo)
|
||||
(vector? (:sync-meta %))
|
||||
(util/uuid-string? (first (:sync-meta %)))
|
||||
(util/uuid-string? (second (:sync-meta %)))) repos)
|
||||
(sync/<sync-start))))))
|
||||
(when-not mobile-or-web?
|
||||
(file-sync/maybe-onboarding-show status))))))))
|
||||
|
||||
(defmethod events/handle :file-sync/onboarding-tip [[_ type opts]]
|
||||
(let [type (keyword type)]
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
[]
|
||||
(when-not (state/sub [:file-sync/remote-graphs :loading])
|
||||
(go
|
||||
(when-not util/web-platform?
|
||||
(when-not (or (util/web-platform?) (util/mobile?))
|
||||
(state/set-state! [:file-sync/remote-graphs :loading] true)
|
||||
(let [graphs-or-exp (<! (<list-graphs))]
|
||||
(when-not (instance? ExceptionInfo graphs-or-exp)
|
||||
|
||||
@@ -172,7 +172,8 @@
|
||||
repos
|
||||
(concat
|
||||
(state/get-rtc-graphs)
|
||||
(state/get-remote-file-graphs)))]
|
||||
(when-not (or (util/mobile?) (util/web-platform?))
|
||||
(state/get-remote-file-graphs))))]
|
||||
(state/set-repos! repos')
|
||||
repos'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user