Skip to content

Commit 2efab21

Browse files
committed
added navigate to biometric screen after sign-in by syncing
1 parent 901644e commit 2efab21

File tree

5 files changed

+31
-17
lines changed

5 files changed

+31
-17
lines changed

Diff for: src/status_im2/contexts/onboarding/enable_biometrics/view.cljs

+11-10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[status-im2.common.parallax.whitelist :as whitelist]
99
[status-im2.common.resources :as resources]
1010
[status-im2.contexts.onboarding.enable-biometrics.style :as style]
11+
[status-im2.navigation.state :as state]
1112
[utils.i18n :as i18n]
1213
[utils.re-frame :as rf]))
1314

@@ -24,7 +25,8 @@
2425
[insets]
2526
(let [supported-biometric-type (rf/sub [:biometric/supported-type])
2627
bio-type-label (biometric/get-label-by-type supported-biometric-type)
27-
profile-color (:color (rf/sub [:onboarding-2/profile]))]
28+
profile-color (or (:color (rf/sub [:onboarding-2/profile]))
29+
(rf/sub [:profile/customization-color]))]
2830
[rn/view {:style (style/buttons insets)}
2931
[quo/button
3032
{:accessibility-label :enable-biometrics-button
@@ -36,16 +38,17 @@
3638
{:accessibility-label :maybe-later-button
3739
:background :blur
3840
:type :grey
39-
:on-press #(rf/dispatch [:onboarding-2/create-account-and-login])
40-
:container-style {:margin-top 12}}
41-
(i18n/label :t/maybe-later)]]))
41+
:on-press #(rf/dispatch (if (= :syncing-results @state/root-id)
42+
[:navigate-to-within-stack
43+
[:enable-notifications :enable-biometrics]]
44+
[:onboarding-2/create-account-and-login]))
45+
:container-style {:margin-top 12}} (i18n/label :t/maybe-later)]]))
4246

4347
(defn enable-biometrics-parallax
4448
[]
4549
(let [stretch (if rn/small-screen? 25 40)]
4650
[parallax/video
47-
{:layers (:biometrics resources/parallax-video)
48-
:stretch stretch}]))
51+
{:layers (:biometrics resources/parallax-video) :stretch stretch}]))
4952

5053
(defn enable-biometrics-simple
5154
[]
@@ -58,9 +61,7 @@
5861
(defn enable-biometrics
5962
[]
6063
(let [insets (safe-area/get-insets)]
61-
[rn/view {:style (style/page-container insets)}
62-
[page-title]
64+
[rn/view {:style (style/page-container insets)} [page-title]
6365
(if whitelist/whitelisted?
6466
[enable-biometrics-parallax]
65-
[enable-biometrics-simple])
66-
[enable-biometrics-buttons insets]]))
67+
[enable-biometrics-simple]) [enable-biometrics-buttons insets]]))

Diff for: src/status_im2/contexts/onboarding/enable_notifications/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
[quo/page-nav
5252
{:background :blur
5353
:icon-name :i/arrow-left
54-
:on-press #(rf/dispatch [:navigate-back-within-stack :new-to-status])}]
54+
:on-press #(rf/dispatch [:navigate-back-within-stack :enable-biometrics])}]
5555
[page-title]
5656
[rn/view {:style style/page-illustration}
5757
[quo/text

Diff for: src/status_im2/contexts/onboarding/events.cljs

+12-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[status-im2.constants :as constants]
77
[status-im2.contexts.profile.create.events :as profile.create]
88
[status-im2.contexts.profile.recover.events :as profile.recover]
9+
[status-im2.navigation.state :as state]
910
[taoensso.timbre :as log]
1011
[utils.i18n :as i18n]
1112
[utils.re-frame :as rf]
@@ -39,7 +40,9 @@
3940
{:events [:onboarding-2/biometrics-done]}
4041
[{:keys [db]}]
4142
{:db (assoc-in db [:onboarding-2/profile :auth-method] constants/auth-method-biometric)
42-
:dispatch [:onboarding-2/create-account-and-login]})
43+
:dispatch (if (= :syncing-results @state/root-id)
44+
[:navigate-to-within-stack [:enable-notifications :enable-biometrics]]
45+
[:onboarding-2/create-account-and-login])})
4346

4447
(rf/defn biometrics-fail
4548
{:events [:onboarding-2/biometrics-fail]}
@@ -83,6 +86,14 @@
8386
[:navigate-to-within-stack [:enable-biometrics :new-to-status]]
8487
[:onboarding-2/create-account-and-login])}))
8588

89+
(rf/defn navigate-to-enable-biometrics
90+
{:events [:onboarding-2/navigate-to-enable-biometrics]}
91+
[{:keys [db]}]
92+
(let [supported-type (:biometric/supported-type db)]
93+
{:dispatch (if supported-type
94+
[:open-modal :enable-biometrics]
95+
[:open-modal :enable-notifications])}))
96+
8697
(rf/defn seed-phrase-entered
8798
{:events [:onboarding-2/seed-phrase-entered]}
8899
[_ seed-phrase on-error]

Diff for: src/status_im2/contexts/onboarding/syncing/results/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
{:on-press (fn []
5555
(when on-press
5656
(on-press))
57-
(rf/dispatch [:open-modal :enable-notifications]))
57+
(rf/dispatch [:onboarding-2/navigate-to-enable-biometrics]))
5858
:accessibility-label :continue-button
5959
:customization-color profile-color
6060
:container-style style/continue-button}

Diff for: src/status_im2/navigation/screens.cljs

+6-4
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,12 @@
157157
:component create-password/create-password}
158158

159159
{:name :enable-biometrics
160-
:options {:theme :dark
161-
:layout options/onboarding-transparent-layout
162-
:animations transitions/push-animations-for-transparent-background
163-
:popGesture false}
160+
:options {:theme :dark
161+
:layout options/onboarding-transparent-layout
162+
:animations (merge transitions/new-to-status-modal-animations
163+
transitions/push-animations-for-transparent-background)
164+
:popGesture false
165+
:modalPresentationStyle :overCurrentContext}
164166
:component enable-biometrics/enable-biometrics}
165167

166168
{:name :generating-keys

0 commit comments

Comments
 (0)