   [{:keys [db] :as cofx} {:keys [error code]}]
   (log/debug "[hardwallet] generate and load key error: " error)
   (fx/merge cofx
-            {:db (assoc-in db [:hardwallet :setup-error] error)}
+            {:db (-> db
+                     (assoc-in [:hardwallet :on-card-connected] :hardwallet/load-loading-keys-screen)
+                     (assoc-in [:hardwallet :setup-error] error))}
             (process-error code error)))
 
 (fx/defn on-get-keys-success

  [{:keys [db] :as cofx} {:keys [error code]}]
  (log/debug "[hardwallet] generate mnemonic error: " error)
  (fx/merge cofx
            {:db (assoc-in db [:hardwallet :setup-error] error)}
            (process-error code error)))

(fx/defn recovery-phrase-start-confirmation [{:keys [db]}]

  [{:keys [db] :as cofx} {:keys [code error]}]
  (log/debug "[hardwallet] install applet and init card error: " error)
  (fx/merge cofx
            {:db (-> db
                     (assoc-in [:hardwallet :on-card-connected] :hardwallet/load-preparing-screen)
                     (assoc-in [:hardwallet :setup-error] error))}
            (process-error code error)))

(def on-init-card-error on-install-applet-and-init-card-error)
