[#9350] fix back button on keycard login screen

This commit is contained in:
Roman Volosovskyi 2019-11-07 10:53:46 +02:00
parent b75e1bd53f
commit 34a4b9a451
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
2 changed files with 12 additions and 4 deletions

View File

@ -482,6 +482,12 @@
(fn [[macc acc]] (fn [[macc acc]]
(some #(when (= (:address %) (:address acc)) %) (:accounts macc)))) (some #(when (= (:address %) (:address acc)) %) (:accounts macc))))
(re-frame/reg-sub
:multiple-multiaccounts?
:<- [:multiaccounts/multiaccounts]
(fn [multiaccounts]
(> (count multiaccounts) 1)))
;;CHAT ============================================================================================================== ;;CHAT ==============================================================================================================
(re-frame/reg-sub (re-frame/reg-sub

View File

@ -3,6 +3,7 @@
(:require [status-im.multiaccounts.core :as multiaccounts] (:require [status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.react :as react] [status-im.ui.components.react :as react]
[status-im.ui.components.toolbar.view :as toolbar] [status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.toolbar.actions :as actions]
[status-im.ui.screens.keycard.styles :as styles] [status-im.ui.screens.keycard.styles :as styles]
[status-im.i18n :as i18n] [status-im.i18n :as i18n]
[status-im.ui.components.colors :as colors] [status-im.ui.components.colors :as colors]
@ -363,15 +364,16 @@
enter-step [:hardwallet/pin-enter-step] enter-step [:hardwallet/pin-enter-step]
status [:hardwallet/pin-status] status [:hardwallet/pin-status]
error-label [:hardwallet/pin-error-label] error-label [:hardwallet/pin-error-label]
multiple-multiaccounts? [:multiple-multiaccounts?]
{:keys [address name] :as account} [:multiaccounts/login]] {:keys [address name] :as account} [:multiaccounts/login]]
[react/view styles/container [react/view styles/container
[toolbar/toolbar [toolbar/toolbar
{:transparent? true {:transparent? true
:style {:margin-top 32}} :style {:margin-top 32}}
[toolbar/nav-text (when multiple-multiaccounts?
{:handler #(re-frame/dispatch [:keycard.login.pin.ui/cancel-pressed]) [toolbar/nav-button
:style {:padding-left 21}} (actions/back
(i18n/label :t/cancel)] #(re-frame/dispatch [:keycard.login.pin.ui/cancel-pressed]))])
[react/text {:style {:color colors/gray}} [react/text {:style {:color colors/gray}}
(i18n/label :t/step-i-of-n {:number 2 (i18n/label :t/step-i-of-n {:number 2
:step 1})] :step 1})]