fix: don't show file graphs on both web and mobile

This commit is contained in:
Tienson Qin
2025-09-05 12:52:47 +08:00
parent cba8520ed9
commit cfbb563bc5
5 changed files with 18 additions and 12 deletions

View File

@@ -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}]

View File

@@ -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)))

View File

@@ -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)]

View File

@@ -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)

View File

@@ -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'))