diff --git a/src/status_im/hardwallet/common.cljs b/src/status_im/hardwallet/common.cljs index 5887ad46ef..dd1dcf893f 100644 --- a/src/status_im/hardwallet/common.cljs +++ b/src/status_im/hardwallet/common.cljs @@ -468,19 +468,23 @@ (fx/defn verify-pin {:events [:hardwallet/verify-pin]} [{:keys [db] :as cofx} {:keys [pin-step on-card-connected on-failure on-success]}] - (fx/merge - cofx - {:db (update-in db [:hardwallet :pin] assoc - :on-verified on-success - :on-verified-failure on-failure)} - (show-connection-sheet - {:on-card-connected (or on-card-connected :hardwallet/verify-pin) - :handler - (fn [{:keys [db] :as cofx}] - (let [pin (vector->string (get-in db [:hardwallet :pin pin-step])) - pairing (get-pairing db)] - (fx/merge - cofx - {:db (assoc-in db [:hardwallet :pin :status] :verifying) - :hardwallet/verify-pin {:pin pin - :pairing pairing}})))}))) + (let [on-success (or on-success + (get-in db [:hardwallet :pin :on-verified])) + on-failure (or on-failure + (get-in db [:hardwallet :pin :on-verified-failure]))] + (fx/merge + cofx + {:db (update-in db [:hardwallet :pin] assoc + :on-verified on-success + :on-verified-failure on-failure)} + (show-connection-sheet + {:on-card-connected (or on-card-connected :hardwallet/verify-pin) + :handler + (fn [{:keys [db] :as cofx}] + (let [pin (vector->string (get-in db [:hardwallet :pin pin-step])) + pairing (get-pairing db)] + (fx/merge + cofx + {:db (assoc-in db [:hardwallet :pin :status] :verifying) + :hardwallet/verify-pin {:pin pin + :pairing pairing}})))})))) diff --git a/src/status_im/hardwallet/core.cljs b/src/status_im/hardwallet/core.cljs index 33acd9337e..ffd2550a8e 100644 --- a/src/status_im/hardwallet/core.cljs +++ b/src/status_im/hardwallet/core.cljs @@ -287,7 +287,8 @@ pin (get-in db [:hardwallet :pin enter-step]) numbers-entered (count pin)] (log/debug "[hardwallet] process-pin-input" - "enter-step" enter-step) + "enter-step" enter-step + "numbers-entered" numbers-entered) (cond-> {:db (assoc-in db [:hardwallet :pin :status] nil)} (and (= enter-step :login) @@ -309,7 +310,7 @@ (and (= enter-step :current) (= pin-code-length numbers-entered)) - (common/verify-pin :current) + (common/verify-pin {:pin-step :current}) (and (= enter-step :export-key) (= pin-code-length numbers-entered)) diff --git a/src/status_im/ui/screens/keycard/views.cljs b/src/status_im/ui/screens/keycard/views.cljs index 4ffb07a564..1dec119ab8 100644 --- a/src/status_im/ui/screens/keycard/views.cljs +++ b/src/status_im/ui/screens/keycard/views.cljs @@ -237,7 +237,6 @@ enter-step [:hardwallet/pin-enter-step] status [:hardwallet/pin-status] error-label [:hardwallet/pin-error-label] - multiple-multiaccounts? [:multiple-multiaccounts?] {:keys [key-uid name] :as account} [:multiaccounts/login] small-screen? [:dimensions/small-screen?] retry-counter [:hardwallet/retry-counter]]