Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keycard bugfixes #9053

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/status_im/hardwallet/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@
(fx/merge cofx
(remove-listener-to-hardware-back-button)
(navigation/navigate-reset {:index 0
:actions [{:routeName (if (:multiaccounts/multiaccounts db)
:multiaccounts :intro)}]})))
:actions [{:routeName (if (seq (:multiaccounts/multiaccounts db))
:multiaccounts
:intro)}]})))

(fx/defn load-finishing-screen
{:events [:keycard.onboarding.recovery-phrase-confirm-word2.ui/next-pressed
Expand Down Expand Up @@ -675,6 +676,10 @@
flow (get-in db [:hardwallet :flow])]
(fx/merge cofx
{:db (-> db
(update :hardwallet
dissoc :secrets :card-state :multiaccount-wallet-address
:multiaccount-whisper-public-key
:application-info)
(assoc-in [:hardwallet :setup-step] :begin)
(assoc-in [:hardwallet :on-card-connected] :hardwallet/get-application-info)
(assoc-in [:hardwallet :on-card-read] :hardwallet/check-card-state)
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/init/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
:initial-props initial-props
:desktop/desktop (merge desktop (:desktop/desktop app-db))
:network/type type
:hardwallet hardwallet
:hardwallet (dissoc hardwallet :secrets)
:supported-biometric-auth supported-biometric-auth
:view-id view-id
:push-notifications/stored stored)})
Expand Down
13 changes: 9 additions & 4 deletions src/status_im/ui/screens/profile/user/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
opts)])

(defn- flat-list-content [preferred-name registrar tribute-to-talk
active-contacts-count show-backup-seed?]
active-contacts-count show-backup-seed?
keycard-account?]
[(cond-> {:title (or preferred-name :t/ens-usernames)
:subtitle (if (boolean registrar)
(if preferred-name
Expand Down Expand Up @@ -163,7 +164,8 @@
:accessories [:chevron]
:on-press #(re-frame/dispatch [:navigate-to :sync-settings])}
(when (and platform/android?
config/hardwallet-enabled?)
config/hardwallet-enabled?
keycard-account?)
{:icon :main-icons/keycard
:title :t/keycard
:accessibility-label :keycard-button
Expand Down Expand Up @@ -198,7 +200,9 @@
{:keys [public-key
preferred-name
seed-backed-up?
mnemonic]
mnemonic
keycard-key-uid
address]
:as multiaccount} [:multiaccount]
active-contacts-count [:contacts/active-count]
tribute-to-talk [:tribute-to-talk/profile]
Expand All @@ -214,7 +218,8 @@
header (header multiaccount)
content (flat-list-content
preferred-name registrar tribute-to-talk
active-contacts-count show-backup-seed?)
active-contacts-count show-backup-seed?
keycard-key-uid)

;; generated toolbar and content with header
generated-view (large-toolbar/generate-view
Expand Down
6 changes: 4 additions & 2 deletions src/status_im/ui/screens/wallet/accounts/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,15 @@
[icons/icon :main-icons/more {:accessibility-label :accounts-more-options}]]]]))

(views/defview accounts []
(views/letsubs [{:keys [accounts]} [:multiaccount]]
(views/letsubs [{:keys [accounts address keycard-key-uid]} [:multiaccount]]
[react/scroll-view {:horizontal true}
[react/view {:flex-direction :row :padding-top 11 :padding-bottom 12}
(for [account accounts]
^{:key account}
[account-card account])
[add-card]]]))
; TODO: enable keycard support for adding new accounts
(when-not keycard-key-uid
[add-card])]]))

(defn accounts-overview []
[react/view {:flex 1}
Expand Down