|
@@ -89,30 +89,31 @@
|
|
(file-sync-handler/set-sync-enabled! true)))
|
|
(file-sync-handler/set-sync-enabled! true)))
|
|
|
|
|
|
(defmethod handle :user/fetch-info-and-graphs [[_]]
|
|
(defmethod handle :user/fetch-info-and-graphs [[_]]
|
|
- (state/set-state! [:ui/loading? :login] false)
|
|
|
|
(async/go
|
|
(async/go
|
|
- (let [result (async/<! (sync/<user-info sync/remoteapi))]
|
|
|
|
- (cond
|
|
|
|
- (instance? ExceptionInfo result)
|
|
|
|
- nil
|
|
|
|
- (map? result)
|
|
|
|
- (do
|
|
|
|
- (state/set-user-info! result)
|
|
|
|
- (when-let [uid (user-handler/user-uuid)]
|
|
|
|
- (sentry-event/set-user! uid))
|
|
|
|
- (let [status (if (user-handler/alpha-or-beta-user?) :welcome :unavailable)]
|
|
|
|
- (when (and (= status :welcome) (user-handler/logged-in?))
|
|
|
|
- (enable-beta-features!)
|
|
|
|
- (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)))))
|
|
|
|
- (ui-handler/re-render-root!)
|
|
|
|
- (file-sync/maybe-onboarding-show status)))))))
|
|
|
|
|
|
+ (when (state/enable-sync?)
|
|
|
|
+ (state/set-state! [:ui/loading? :login] false)
|
|
|
|
+ (let [result (async/<! (sync/<user-info sync/remoteapi))]
|
|
|
|
+ (cond
|
|
|
|
+ (instance? ExceptionInfo result)
|
|
|
|
+ nil
|
|
|
|
+ (map? result)
|
|
|
|
+ (do
|
|
|
|
+ (state/set-user-info! result)
|
|
|
|
+ (when-let [uid (user-handler/user-uuid)]
|
|
|
|
+ (sentry-event/set-user! uid))
|
|
|
|
+ (let [status (if (user-handler/alpha-or-beta-user?) :welcome :unavailable)]
|
|
|
|
+ (when (and (= status :welcome) (user-handler/logged-in?))
|
|
|
|
+ (enable-beta-features!)
|
|
|
|
+ (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)))))
|
|
|
|
+ (ui-handler/re-render-root!)
|
|
|
|
+ (file-sync/maybe-onboarding-show status))))))))
|
|
|
|
|
|
(defmethod handle :user/logout [[_]]
|
|
(defmethod handle :user/logout [[_]]
|
|
(file-sync-handler/reset-session-graphs)
|
|
(file-sync-handler/reset-session-graphs)
|
|
@@ -749,15 +750,17 @@
|
|
:close-backdrop? false} opts)))
|
|
:close-backdrop? false} opts)))
|
|
|
|
|
|
(defmethod handle :file-sync/onboarding-tip [[_ type opts]]
|
|
(defmethod handle :file-sync/onboarding-tip [[_ type opts]]
|
|
- (let [type (keyword type)]
|
|
|
|
- (state/set-modal!
|
|
|
|
- (file-sync/make-onboarding-panel type)
|
|
|
|
- (merge {:close-btn? false
|
|
|
|
- :center? true
|
|
|
|
- :close-backdrop? (not= type :welcome)} opts))))
|
|
|
|
|
|
+ (when (state/enable-sync?)
|
|
|
|
+ (let [type (keyword type)]
|
|
|
|
+ (state/set-modal!
|
|
|
|
+ (file-sync/make-onboarding-panel type)
|
|
|
|
+ (merge {:close-btn? false
|
|
|
|
+ :center? true
|
|
|
|
+ :close-backdrop? (not= type :welcome)} opts)))))
|
|
|
|
|
|
(defmethod handle :file-sync/maybe-onboarding-show [[_ type]]
|
|
(defmethod handle :file-sync/maybe-onboarding-show [[_ type]]
|
|
- (file-sync/maybe-onboarding-show type))
|
|
|
|
|
|
+ (when (state/enable-sync?)
|
|
|
|
+ (file-sync/maybe-onboarding-show type)))
|
|
|
|
|
|
(defmethod handle :file-sync/storage-exceed-limit [[_]]
|
|
(defmethod handle :file-sync/storage-exceed-limit [[_]]
|
|
(notification/show! "file sync storage exceed limit" :warning false)
|
|
(notification/show! "file sync storage exceed limit" :warning false)
|