Skip to content

Commit 7086a6f

Browse files
committed
Onboarding readd biometric screen to syncing flow
1 parent 32a3f85 commit 7086a6f

File tree

9 files changed

+45
-195
lines changed

9 files changed

+45
-195
lines changed

src/status_im/contexts/centralized_metrics/tracking.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
(contains? view-ids-to-track view-id)
5353
(conj (navigation-event (name view-id)))
5454

55-
(= :screen/onboarding.syncing-results view-id)
55+
(#{:screen/onboarding.preparing-status :screen/onboarding.syncing-biometric} view-id)
5656
(conj (key-value-event "onboarding-completed"))
5757

5858
(= :screen/keycard.migrate.success view-id)

src/status_im/contexts/onboarding/enable_biometrics/view.cljs

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
[status-im.common.biometric.utils :as biometric]
77
[status-im.common.resources :as resources]
88
[status-im.contexts.onboarding.enable-biometrics.style :as style]
9-
[status-im.navigation.state :as state]
109
[utils.i18n :as i18n]
1110
[utils.re-frame :as rf]))
1211

@@ -25,7 +24,7 @@
2524
bio-type-label (biometric/get-label-by-type supported-biometric-type)
2625
profile-color (or (:color (rf/sub [:onboarding/profile]))
2726
(rf/sub [:profile/customization-color]))
28-
syncing-results? (= :screen/onboarding.syncing-results @state/root-id)
27+
syncing? (= (rf/sub [:view-id]) :screen/onboarding.syncing-biometric)
2928
biometric-type (rf/sub [:biometrics/supported-type])]
3029
[rn/view {:style (style/buttons insets)}
3130
[quo/button
@@ -39,10 +38,8 @@
3938
{:accessibility-label :maybe-later-button
4039
:background :blur
4140
:type :grey
42-
:on-press #(rf/dispatch (if syncing-results?
43-
[:navigate-to-within-stack
44-
[:screen/onboarding.enable-notifications
45-
:screen/onboarding.enable-biometrics]]
41+
:on-press #(rf/dispatch (if syncing?
42+
[:onboarding/finish-onboarding false]
4643
[:onboarding/create-account-and-login]))
4744
:container-style {:margin-top 12}}
4845
(i18n/label :t/maybe-later)]]))

src/status_im/contexts/onboarding/events.cljs

+1-15
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@
3838
(fn [{:keys [db]}]
3939
{:db (dissoc db :onboarding/navigated-to-enter-seed-phrase-from-screen)}))
4040

41-
(rf/reg-event-fx :onboarding/navigate-to-enable-notifications-from-syncing
42-
(fn [{:keys [db]}]
43-
{:db (dissoc db :onboarding/profile)
44-
:dispatch [:navigate-to-within-stack
45-
[:screen/onboarding.enable-notifications :screen/onboarding.enable-biometrics]]}))
46-
4741
(rf/reg-event-fx :onboarding/navigate-to-enable-notifications
4842
(fn [{:keys [db]}]
4943
{:dispatch [:navigate-to-within-stack
@@ -113,14 +107,6 @@
113107
[:navigate-to-within-stack [:screen/onboarding.enable-biometrics from-screen]]
114108
[:onboarding/create-account-and-login])]]})))
115109

116-
(rf/reg-event-fx
117-
:onboarding/navigate-to-enable-biometrics
118-
(fn [{:keys [db]}]
119-
(let [supported-type (get-in db [:biometrics :supported-type])]
120-
{:dispatch (if supported-type
121-
[:open-modal :screen/onboarding.enable-biometrics]
122-
[:open-modal :screen/onboarding.enable-notifications])})))
123-
124110
(rf/reg-event-fx
125111
:onboarding/seed-phrase-validated
126112
(fn [{:keys [db]} [seed-phrase key-uid]]
@@ -200,7 +186,7 @@
200186
(rf/dispatch [:onboarding/set-auth-method auth-method])
201187
(when syncing?
202188
(rf/dispatch
203-
[:onboarding/navigate-to-enable-notifications-from-syncing])))
189+
[:onboarding/finish-onboarding false])))
204190
:on-error #(log/error "failed to save biometrics"
205191
{:key-uid key-uid
206192
:error %})}])]})))

src/status_im/contexts/onboarding/syncing/progress/view.cljs

+19-18
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,25 @@
4141

4242
(defn try-again-button
4343
[profile-color logged-in?]
44-
[quo/bottom-actions
45-
{:actions (if logged-in? :one-action :two-vertical-actions)
46-
:blur? true
47-
:container-style {:height (when-not logged-in? 116)}
48-
:button-two-label (i18n/label :t/use-recovery-phrase)
49-
:button-two-props {:type :primary
50-
:accessibility-label :try-seed-phrase-button
51-
:customization-color profile-color
52-
:size 40
53-
:on-press navigate-to-enter-seed-phrase}
54-
:button-one-label
55-
(i18n/label :t/try-again)
56-
:button-one-props
57-
{:type (if logged-in? :primary :grey)
58-
:accessibility-label :try-again-later-button
59-
:customization-color profile-color
60-
:size 40
61-
:on-press #(try-again logged-in?)}}])
44+
(let [two-vertical-actions-height 116]
45+
[quo/bottom-actions
46+
{:actions (if logged-in? :one-action :two-vertical-actions)
47+
:blur? true
48+
:container-style {:height (when-not logged-in? two-vertical-actions-height)}
49+
:button-two-label (i18n/label :t/use-recovery-phrase)
50+
:button-two-props {:type :primary
51+
:accessibility-label :try-seed-phrase-button
52+
:customization-color profile-color
53+
:size 40
54+
:on-press navigate-to-enter-seed-phrase}
55+
:button-one-label
56+
(i18n/label :t/try-again)
57+
:button-one-props
58+
{:type (if logged-in? :primary :grey)
59+
:accessibility-label :try-again-later-button
60+
:customization-color profile-color
61+
:size 40
62+
:on-press #(try-again logged-in?)}}]))
6263

6364
(defn- illustration
6465
[pairing-progress?]

src/status_im/contexts/onboarding/syncing/results/style.cljs

-43
This file was deleted.

src/status_im/contexts/onboarding/syncing/results/view.cljs

-84
This file was deleted.

src/status_im/contexts/profile/login/events.cljs

+16-15
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,19 @@
3737
;; login phase 1: we want to load and show chats faster, so we split login into 2 phases
3838
(rf/reg-event-fx :profile.login/login-existing-profile
3939
(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])]
5253
{:db (cond-> new-db
5354
pairing-completed? (dissoc :syncing))
5455
:fx (into [[:json-rpc/call
@@ -81,10 +82,10 @@
8182
(when keycard?
8283
[:dispatch [:centralized-metrics/track :metric/keycard-login]])]
8384
(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]]]
8687

87-
(get db :onboarding/new-account?)
88+
(or pairing-completed? (get db :onboarding/new-account?))
8889
[[:dispatch [:onboarding/finalize-setup]]
8990
[:dispatch [:onboarding/finish-onboarding false]]]
9091

src/status_im/navigation/roots.cljs

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
:id :screen/profile.profiles
2727
:options (options/dark-root-options)}}]}}}
2828

29-
:screen/onboarding.syncing-results
30-
{:root {:stack {:children [{:component {:name :screen/onboarding.syncing-results
31-
:id :screen/onboarding.syncing-results
29+
:screen/onboarding.syncing-biometric
30+
{:root {:stack {:id :screen/onboarding.enable-biometrics
31+
:children [{:component {:name :screen/onboarding.enable-biometrics
32+
:id :screen/onboarding.enable-biometrics
3233
:options (options/dark-root-options)}}]}}}})
3334

3435
(defn old-roots

src/status_im/navigation/screens.cljs

+1-10
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
[status-im.contexts.onboarding.share-usage.view :as onboarding.share-usage]
5454
[status-im.contexts.onboarding.sign-in.view :as sign-in]
5555
[status-im.contexts.onboarding.syncing.progress.view :as syncing-devices]
56-
[status-im.contexts.onboarding.syncing.results.view :as syncing-results]
5756
[status-im.contexts.preview.feature-flags.view :as feature-flags]
5857
[status-im.contexts.preview.quo.component-preview.view :as component-preview]
5958
[status-im.contexts.preview.quo.main :as quo.preview]
@@ -855,13 +854,6 @@
855854
:popGesture false}
856855
:component syncing-devices/view-onboarding})
857856

858-
(def onboarding-syncing-results
859-
{:name :screen/onboarding.syncing-results
860-
:metrics {:track? true
861-
:alias-id :onboarding.syncing-completed}
862-
:options {:theme :dark}
863-
:component syncing-results/view})
864-
865857
(def onboarding-screens
866858
[onboarding-intro
867859
onboarding-create-profile
@@ -875,8 +867,7 @@
875867
onboarding-sign-in-intro
876868
onboarding-sign-in
877869
onboarding-syncing-progress
878-
onboarding-syncing-progress-intro
879-
onboarding-syncing-results])
870+
onboarding-syncing-progress-intro])
880871

881872
(def keycard-screens
882873
[{:name :screen/keycard.check

0 commit comments

Comments
 (0)