[#9577] Fix keycard account creation after card reconnection

`:on-card-read` callback wasn't properly cleared before entering pin.
This commit is contained in:
Roman Volosovskyi 2019-12-04 17:12:10 +02:00
parent 78d694f52f
commit 5ccf1c0377
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
1 changed files with 7 additions and 2 deletions

View File

@ -516,7 +516,11 @@
(when (= card-state :pre-init) (when (= card-state :pre-init)
(if (= flow :import) (if (= flow :import)
(navigation/navigate-to-cofx :keycard-recovery-no-key nil) (navigation/navigate-to-cofx :keycard-recovery-no-key nil)
(load-pin-screen))) (fn [cofx]
(fx/merge
cofx
(clear-on-card-read)
(load-pin-screen)))))
(when (and (= card-state :multiaccount) (when (and (= card-state :multiaccount)
(= flow :import)) (= flow :import))
(let [{:keys [address]} (find-multiaccount-by-key-uid db key-uid)] (let [{:keys [address]} (find-multiaccount-by-key-uid db key-uid)]
@ -1418,9 +1422,10 @@
(fx/defn process-pin-input (fx/defn process-pin-input
[{:keys [db]}] [{:keys [db]}]
(let [enter-step (get-in db [:hardwallet :pin :enter-step]) (let [enter-step (get-in db [:hardwallet :pin :enter-step])
setup-step (get-in db [:hardwallet :setup-step])
pin (get-in db [:hardwallet :pin enter-step]) pin (get-in db [:hardwallet :pin enter-step])
numbers-entered (count pin)] numbers-entered (count pin)]
(log/debug "[hardwallet] process-pin-input"
"enter-step" enter-step)
(cond-> {:db (assoc-in db [:hardwallet :pin :status] nil)} (cond-> {:db (assoc-in db [:hardwallet :pin :status] nil)}
(and (= enter-step :login) (and (= enter-step :login)