mirror of
https://github.com/status-im/status-react.git
synced 2025-02-02 06:07:33 +00:00
[#9393] fix mnemonic shown during storing account on keycard
This commit is contained in:
parent
9311fee2ae
commit
10c45d8a79
@ -368,6 +368,29 @@
|
||||
(listen-to-hardware-back-button)
|
||||
(navigation/navigate-to-cofx :keycard-recovery-pin nil)))
|
||||
|
||||
(fx/defn on-generate-mnemonic-success
|
||||
[{:keys [db] :as cofx} mnemonic]
|
||||
(fx/merge cofx
|
||||
{:db (-> db
|
||||
(assoc-in [:hardwallet :setup-step] :recovery-phrase)
|
||||
(assoc-in [:hardwallet :on-card-connected] nil)
|
||||
(assoc-in [:hardwallet :secrets :mnemonic] mnemonic))}
|
||||
(navigation/navigate-to-cofx :keycard-onboarding-recovery-phrase nil)))
|
||||
|
||||
(fx/defn set-mnemonic
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [selected-id (get-in db [:intro-wizard :selected-id])
|
||||
accounts (get-in db [:intro-wizard :multiaccounts])
|
||||
mnemonic (->> accounts
|
||||
(filter (fn [{:keys [id]}]
|
||||
(= id selected-id)))
|
||||
first
|
||||
:mnemonic)]
|
||||
(fx/merge
|
||||
cofx
|
||||
{:db (assoc-in db [:hardwallet :secrets :mnemonic] mnemonic)}
|
||||
(on-generate-mnemonic-success mnemonic))))
|
||||
|
||||
(fx/defn generate-mnemonic
|
||||
[cofx]
|
||||
(let [{:keys [pairing]} (get-in cofx [:db :hardwallet :secrets])]
|
||||
@ -1539,7 +1562,7 @@
|
||||
(when (= flow :import)
|
||||
(load-recovery-pin-screen))
|
||||
(when (= flow :create)
|
||||
(generate-mnemonic)))))
|
||||
(set-mnemonic)))))
|
||||
|
||||
(fx/defn on-pair-error
|
||||
[{:keys [db] :as cofx} {:keys [error code]}]
|
||||
@ -1557,15 +1580,6 @@
|
||||
(when (not= setup-step :enter-pair-code)
|
||||
(process-error code error)))))
|
||||
|
||||
(fx/defn on-generate-mnemonic-success
|
||||
[{:keys [db] :as cofx} mnemonic]
|
||||
(fx/merge cofx
|
||||
{:db (-> db
|
||||
(assoc-in [:hardwallet :setup-step] :recovery-phrase)
|
||||
(assoc-in [:hardwallet :on-card-connected] nil)
|
||||
(assoc-in [:hardwallet :secrets :mnemonic] mnemonic))}
|
||||
(navigation/navigate-to-cofx :keycard-onboarding-recovery-phrase nil)))
|
||||
|
||||
(fx/defn on-generate-mnemonic-error
|
||||
[{:keys [db] :as cofx} {:keys [error code]}]
|
||||
(log/debug "[hardwallet] generate mnemonic error: " error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user