From c9cdd4884902f56b5dbcf732c02b334c01e11441 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Wed, 25 Mar 2020 16:45:05 +0200 Subject: [PATCH] [#9705] fix java.lang.IllegalArgumentException: 16 > 0 after entering PIN code --- src/status_im/hardwallet/core.cljs | 4 +++- src/status_im/hardwallet/mnemonic.cljs | 1 + src/status_im/hardwallet/onboarding.cljs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/status_im/hardwallet/core.cljs b/src/status_im/hardwallet/core.cljs index e60999f524..dd76467da8 100644 --- a/src/status_im/hardwallet/core.cljs +++ b/src/status_im/hardwallet/core.cljs @@ -171,6 +171,7 @@ {:db (update-in db [:hardwallet :pin] merge {:status nil :error-label nil})} (common/clear-on-card-connected) + (common/clear-on-card-read) ;; TODO(Ferossgp): Each pin input should handle this event on it's own, ;; now for simplicity do not hide bottom sheet when generating key ;; but should be refactored. @@ -179,7 +180,8 @@ (when-not (contains? #{:hardwallet/unpair :hardwallet/generate-and-load-key :hardwallet/remove-key-with-unpair - :hardwallet/unpair-and-delete} on-verified) + :hardwallet/unpair-and-delete + :hardwallet/generate-mnemonic} on-verified) (common/get-application-info pairing nil)) (when on-verified (dispatch-on-verified-event on-verified))))) diff --git a/src/status_im/hardwallet/mnemonic.cljs b/src/status_im/hardwallet/mnemonic.cljs index ea4299ea87..1513b90d6c 100644 --- a/src/status_im/hardwallet/mnemonic.cljs +++ b/src/status_im/hardwallet/mnemonic.cljs @@ -72,6 +72,7 @@ (fx/defn proceed-to-generate-mnemonic {:events [:hardwallet/proceed-to-generate-mnemonic]} [{:keys [db] :as cofx}] + (log/debug "[hardwallet] proceed-to-generate-mnemonic") (if (= (get-in db [:hardwallet :flow]) :create) (load-generating-mnemonic-screen cofx) {:db (assoc-in db [:hardwallet :setup-step] :recovery-phrase)})) diff --git a/src/status_im/hardwallet/onboarding.cljs b/src/status_im/hardwallet/onboarding.cljs index 66eb1b62ec..3900da22d6 100644 --- a/src/status_im/hardwallet/onboarding.cljs +++ b/src/status_im/hardwallet/onboarding.cljs @@ -218,6 +218,7 @@ (fx/defn card-ready-next-button-pressed {:events [:hardwallet.ui/card-ready-next-button-pressed]} [{:keys [db] :as cofx}] + (log/debug "[hardwallet] card-ready-next-button-pressed") (let [pin (get-in db [:hardwallet :secrets :pin]) pin-already-set? (boolean pin)] (if pin-already-set?