|
37 | 37 | ;; login phase 1: we want to load and show chats faster, so we split login into 2 phases
|
38 | 38 | (rf/reg-event-fx :profile.login/login-existing-profile
|
39 | 39 | (fn [{:keys [db]} [settings-data account]]
|
40 |
| - (let [settings (data-store.settings/rpc->settings settings-data) |
41 |
| - profile-overview (profile.rpc/rpc->profiles-overview account) |
42 |
| - log-level (or (:log-level settings) config/log-level) |
43 |
| - pairing-completed? (= (get-in db [:syncing :pairing-status]) :completed) |
44 |
| - new-db (-> db |
45 |
| - (assoc :profile/profile |
46 |
| - (merge profile-overview |
47 |
| - settings |
48 |
| - {:log-level log-level})) |
49 |
| - (assoc-in [:activity-center :loading?] true) |
50 |
| - (dissoc :centralized-metrics/onboarding-enabled?)) |
51 |
| - keycard? (get-in new-db [:profile/profile :keycard-pairing])] |
| 40 | + (let [settings (data-store.settings/rpc->settings settings-data) |
| 41 | + profile-overview (profile.rpc/rpc->profiles-overview account) |
| 42 | + log-level (or (:log-level settings) config/log-level) |
| 43 | + pairing-completed? (= (get-in db [:syncing :pairing-status]) :completed) |
| 44 | + biometric-supported-type (get-in db [:biometrics :supported-type]) |
| 45 | + new-db (-> db |
| 46 | + (assoc :profile/profile |
| 47 | + (merge profile-overview |
| 48 | + settings |
| 49 | + {:log-level log-level})) |
| 50 | + (assoc-in [:activity-center :loading?] true) |
| 51 | + (dissoc :centralized-metrics/onboarding-enabled?)) |
| 52 | + keycard? (get-in new-db [:profile/profile :keycard-pairing])] |
52 | 53 | {:db (cond-> new-db
|
53 | 54 | pairing-completed? (dissoc :syncing))
|
54 | 55 | :fx (into [[:json-rpc/call
|
|
81 | 82 | (when keycard?
|
82 | 83 | [:dispatch [:centralized-metrics/track :metric/keycard-login]])]
|
83 | 84 | (cond
|
84 |
| - pairing-completed? |
85 |
| - [[:dispatch [:onboarding/finish-onboarding false]]] |
| 85 | + (and pairing-completed? biometric-supported-type) |
| 86 | + [[:dispatch [:update-theme-and-init-root :screen/onboarding.syncing-biometric]]] |
86 | 87 |
|
87 |
| - (get db :onboarding/new-account?) |
| 88 | + (or pairing-completed? (get db :onboarding/new-account?)) |
88 | 89 | [[:dispatch [:onboarding/finalize-setup]]
|
89 | 90 | [:dispatch [:onboarding/finish-onboarding false]]]
|
90 | 91 |
|
|
0 commit comments