              :hardwallet/register-card-events nil
              :db                              (-> db
                                                   (assoc-in [:hardwallet :setup-step] :begin)
-                                                  (assoc-in [:hardwallet :on-card-connected] nil)
+                                                  (assoc-in [:hardwallet :on-card-connected] :hardwallet/get-application-info)
                                                   (assoc-in [:hardwallet :on-card-read] :hardwallet/check-card-state)
                                                   (assoc-in [:hardwallet :pin :on-verified] nil))}
             (navigation/navigate-to-cofx :hardwallet-connect nil)))

                                              :original     []
                                              :confirmation []}))

(fx/defn wait-for-card-tap
  [{:keys [db] :as cofx}]
  (let [card-connected? (get-in db [:hardwallet :card-connected?])]
    (if card-connected?
      (login-with-keycard cofx false)
      (fx/merge cofx
                {:db (-> db
                         (assoc-in [:hardwallet :on-card-read] :hardwallet/login-with-keycard))}
                (navigation/navigate-to-cofx :hardwallet-connect nil)))))


    (fx/merge cofx
              {:db (-> db
                       (assoc-in [:hardwallet :setup-error] (i18n/label :t/invalid-pairing-password))
                       (assoc-in [:hardwallet :on-card-connected] (if (= setup-step :pairing)
                                                                    :hardwallet/load-pairing-screen
                                                                    :hardwallet/pair)))}
              (when (not= setup-step :enter-pair-code)
                (process-error code error)))))

