[#10439] Fix transaction signing after tapping wrong card

This commit is contained in:
Roman Volosovskyi 2020-06-12 12:34:19 +03:00
parent b25c1413f4
commit ee2dec5b27
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
1 changed files with 12 additions and 6 deletions

View File

@ -427,11 +427,15 @@
(fx/defn on-get-application-info-error (fx/defn on-get-application-info-error
{:events [:hardwallet.callback/on-get-application-info-error]} {:events [:hardwallet.callback/on-get-application-info-error]}
[{:keys [db] :as cofx} error] [{:keys [db] :as cofx} error]
(log/debug "[hardwallet] application info error " error) (let [on-card-read (get-in db [:hardwallet :on-card-read])
(let [on-card-read (get-in db [:hardwallet :on-card-read]) on-card-connected (get-in db [:hardwallet :on-card-connected])
on-card-connected (get-in db [:hardwallet :on-card-connected]) last-on-card-connected (get-in db [:hardwallet :last-on-card-connected])
login? (= on-card-read :hardwallet/login-with-keycard) login? (= on-card-read :hardwallet/login-with-keycard)
tag-was-lost? (tag-lost? (:error error))] tag-was-lost? (tag-lost? (:error error))]
(log/debug "[hardwallet] application info error"
error
on-card-connected
last-on-card-connected)
(when-not tag-was-lost? (when-not tag-was-lost?
(if login? (if login?
(fx/merge cofx (fx/merge cofx
@ -440,7 +444,9 @@
(fx/merge cofx (fx/merge cofx
{:db (assoc-in db [:hardwallet :application-info-error] error)} {:db (assoc-in db [:hardwallet :application-info-error] error)}
(when (= on-card-connected :hardwallet/prepare-to-sign) (when (contains?
#{last-on-card-connected on-card-connected}
:hardwallet/prepare-to-sign)
(show-wrong-keycard-alert true)) (show-wrong-keycard-alert true))
(when on-card-read (when on-card-read