|
38 | 38 | (fn [{:keys [db]}]
|
39 | 39 | {:db (dissoc db :onboarding/navigated-to-enter-seed-phrase-from-screen)}))
|
40 | 40 |
|
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 |
| - |
47 | 41 | (rf/reg-event-fx :onboarding/navigate-to-enable-notifications
|
48 | 42 | (fn [{:keys [db]}]
|
49 | 43 | {:dispatch [:navigate-to-within-stack
|
|
55 | 49 | (rf/defn biometrics-done
|
56 | 50 | {:events [:onboarding/biometrics-done]}
|
57 | 51 | [{:keys [db]}]
|
58 |
| - (let [syncing? (get-in db [:onboarding/profile :syncing?])] |
| 52 | + (let [syncing? (get-in db [:onboarding/profile :connection-string])] |
59 | 53 | {:db (assoc-in db [:onboarding/profile :auth-method] constants/auth-method-biometric)
|
60 | 54 | :dispatch (if syncing?
|
61 |
| - [:onboarding/finalize-setup] |
| 55 | + [:syncing/initiate-local-pairing-with-stored-connection-string] |
62 | 56 | [:onboarding/create-account-and-login])}))
|
63 | 57 |
|
64 | 58 | (rf/reg-event-fx
|
|
107 | 101 | :screen/onboarding.create-profile)]
|
108 | 102 | {:db (-> db
|
109 | 103 | (assoc-in [:onboarding/profile :password] masked-password)
|
| 104 | + (update-in [:onboarding/profile] dissoc :connection-string) |
110 | 105 | (assoc-in [:onboarding/profile :auth-method] constants/auth-method-password))
|
111 | 106 | :fx [[:dispatch
|
112 | 107 | (if biometric-supported-type
|
113 | 108 | [:navigate-to-within-stack [:screen/onboarding.enable-biometrics from-screen]]
|
114 | 109 | [:onboarding/create-account-and-login])]]})))
|
115 | 110 |
|
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 |
| - |
124 | 111 | (rf/reg-event-fx
|
125 | 112 | :onboarding/seed-phrase-validated
|
126 | 113 | (fn [{:keys [db]} [seed-phrase key-uid]]
|
|
187 | 174 | temporary-display-name?]} (:onboarding/profile db)
|
188 | 175 | {:keys [key-uid] :as profile} (:profile/profile db)
|
189 | 176 | biometric-enabled? (= auth-method constants/auth-method-biometric)]
|
190 |
| - {:db (assoc db :onboarding/generated-keys? true) |
| 177 | + (print "----------------" password) |
| 178 | + {:db (-> db |
| 179 | + (assoc :onboarding/generated-keys? true) |
| 180 | + (dissoc :onboarding/profile)) |
191 | 181 | :fx [(when temporary-display-name?
|
192 | 182 | [:dispatch [:profile/set-default-profile-name profile]])
|
193 | 183 | (when biometric-enabled?
|
|
196 | 186 | :masked-password (if syncing?
|
197 | 187 | password
|
198 | 188 | (security/hash-masked-password password))
|
199 |
| - :on-success (fn [] |
200 |
| - (rf/dispatch [:onboarding/set-auth-method auth-method]) |
201 |
| - (when syncing? |
202 |
| - (rf/dispatch |
203 |
| - [:onboarding/navigate-to-enable-notifications-from-syncing]))) |
| 189 | + :on-success [:onboarding/set-auth-method auth-method] |
204 | 190 | :on-error #(log/error "failed to save biometrics"
|
205 | 191 | {:key-uid key-uid
|
206 | 192 | :error %})}])]})))
|
0 commit comments