Skip to content

Commit 0b4cbb1

Browse files
committed
added navigate to biometric screen after sign-in by syncing
1 parent edd6b8d commit 0b4cbb1

File tree

6 files changed

+28
-8
lines changed

6 files changed

+28
-8
lines changed

Diff for: src/react_native/keychain.cljs

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
(defn save-credentials
5959
"Stores the credentials for the address to the Keychain"
6060
[server username password callback]
61+
(js/console.log (str "unmasked pass " password))
6162
(-> (.setInternetCredentials ^js react-native-keychain
6263
(string/lower-case server)
6364
username

Diff for: src/status_im2/common/keychain/events.cljs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
(defn save-auth-method!
5050
[key-uid method]
51+
(js/console.log (str "auth method saved " method))
5152
(keychain/save-credentials
5253
(str key-uid "-auth")
5354
key-uid

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[status-im2.common.parallax.view :as parallax]
77
[status-im2.common.parallax.whitelist :as whitelist]
88
[status-im2.common.resources :as resources]
9+
[status-im2.navigation.state :as state]
910
[status-im2.contexts.onboarding.enable-biometrics.style :as style]
1011
[utils.i18n :as i18n]
1112
[utils.re-frame :as rf]))
@@ -35,7 +36,10 @@
3536
{:accessibility-label :maybe-later-button
3637
:background :blur
3738
:type :grey
38-
:on-press #(rf/dispatch [:onboarding-2/create-account-and-login])
39+
:on-press #(rf/dispatch (if (= :syncing-results @state/root-id)
40+
[:navigate-to-within-stack
41+
[:enable-notifications :enable-biometrics]]
42+
[:onboarding-2/create-account-and-login]))
3943
:container-style {:margin-top 12}}
4044
(i18n/label :t/maybe-later)]]))
4145

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

+14-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[utils.i18n :as i18n]
88
[utils.re-frame :as rf]
99
[utils.security.core :as security]
10+
[status-im2.navigation.state :as state]
1011
[status-im2.contexts.profile.create.events :as profile.create]
1112
[status-im2.contexts.profile.recover.events :as profile.recover]
1213
[status-im2.common.biometric.events :as biometric]))
@@ -30,15 +31,17 @@
3031

3132
(rf/defn enable-biometrics
3233
{:events [:onboarding-2/enable-biometrics]}
33-
[_]
34+
[{:keys [db] :as cofx}]
3435
{:biometric/authenticate {:on-success #(rf/dispatch [:onboarding-2/biometrics-done])
3536
:on-fail #(rf/dispatch [:onboarding-2/biometrics-fail %])}})
3637

3738
(rf/defn biometrics-done
3839
{:events [:onboarding-2/biometrics-done]}
3940
[{:keys [db]}]
4041
{:db (assoc-in db [:onboarding-2/profile :auth-method] constants/auth-method-biometric)
41-
:dispatch [:onboarding-2/create-account-and-login]})
42+
:dispatch (if (= :syncing-results @state/root-id)
43+
[:navigate-to-within-stack [:enable-notifications :enable-biometrics]]
44+
[:onboarding-2/create-account-and-login])})
4245

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

88+
(rf/defn navigate-to-enable-biometrics
89+
{:events [:onboarding-2/navigate-to-enable-biometrics]}
90+
[{:keys [db]}]
91+
(let [supported-type (:biometric/supported-type db)]
92+
{:dispatch (if supported-type
93+
[:open-modal :enable-biometrics]
94+
[:open-modal :enable-notifications])}))
95+
8596
(rf/defn seed-phrase-entered
8697
{:events [:onboarding-2/seed-phrase-entered]}
8798
[_ seed-phrase on-error]
@@ -131,6 +142,7 @@
131142
{:key-uid key-uid
132143
:error %})}))))
133144

145+
134146
(rf/defn navigate-to-identifiers
135147
{:events [:onboarding-2/navigate-to-identifiers]}
136148
[{:keys [db]}]

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

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

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@
155155
:component create-password/create-password}
156156

157157
{:name :enable-biometrics
158-
:options {:theme :dark
159-
:layout options/onboarding-transparent-layout
160-
:animations transitions/push-animations-for-transparent-background
161-
:popGesture false}
158+
:options {:theme :dark
159+
:layout options/onboarding-transparent-layout
160+
:animations (merge transitions/new-to-status-modal-animations
161+
transitions/push-animations-for-transparent-background)
162+
:popGesture false
163+
:modalPresentationStyle :overCurrentContext}
162164
:component enable-biometrics/enable-biometrics}
163165

164166
{:name :generating-keys

0 commit comments

Comments
 (0)