Skip to content

Commit

Permalink
[#9025] fix keycard pairings persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryn committed Sep 26, 2019
1 parent acd7e56 commit a3211a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/status_im/hardwallet/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
[{:keys [db] :as cofx} flow instance-uid]
(if (= flow :import)
(navigation/navigate-to-cofx cofx :keycard-recovery-no-key nil)
(let [pairing-data (get-in db [:hardwallet :pairings (keyword instance-uid)])]
(let [pairing-data (get-in db [:hardwallet :pairings instance-uid])]
(if pairing-data
(fx/merge cofx
{:db (update-in db [:hardwallet :secrets] merge pairing-data)}
Expand Down Expand Up @@ -1505,15 +1505,16 @@
instance-uid (get-in db [:hardwallet :application-info :instance-uid])
multiaccount (find-multiaccount-by-keycard-instance-uid db instance-uid)
paired-on (utils.datetime/timestamp)
pairings (get-in db [:hardwallet :pairings])
pairings (assoc (get-in db [:hardwallet :pairings]) instance-uid {:pairing pairing
:paired-on paired-on})
instance-uid (get-in db [:hardwallet :application-info :instance-uid])
next-step (if (= setup-step :pair)
:begin
:card-ready)]
(fx/merge cofx
{:hardwallet/persist-pairings (assoc pairings instance-uid {:pairing pairing
:paired-on paired-on})
{:hardwallet/persist-pairings pairings
:db (-> db
(assoc-in [:hardwallet :pairings] pairings)
(assoc-in [:hardwallet :application-info :paired?] true)
(assoc-in [:hardwallet :on-card-connected] nil)
(assoc-in [:hardwallet :setup-step] next-step)
Expand Down

0 comments on commit a3211a9

Please sign in to comment.