[#8187] fix keyboard pop-up when logout after keycard setup finished

Signed-off-by: Dmitry Novotochinov <dmitry.novot@gmail.com>
This commit is contained in:
Dmitry Novotochinov 2019-05-13 21:53:36 +03:00
parent 50f9354581
commit 89643b425e
No known key found for this signature in database
GPG Key ID: 43D1DAF5AD39C927
5 changed files with 25 additions and 12 deletions

View File

@ -814,14 +814,17 @@
[{:keys [db] :as cofx}] [{:keys [db] :as cofx}]
(let [pin (vector->string (get-in db [:hardwallet :pin :current])) (let [pin (vector->string (get-in db [:hardwallet :pin :current]))
pairing (get-pairing db) pairing (get-pairing db)
card-connected? (get-in db [:hardwallet :card-connected?])] card-connected? (get-in db [:hardwallet :card-connected?])
setup? (boolean (get-in db [:hardwallet :setup-step]))]
(if card-connected? (if card-connected?
{:db (assoc-in db [:hardwallet :pin :status] :verifying) {:db (assoc-in db [:hardwallet :pin :status] :verifying)
:hardwallet/verify-pin {:pin pin :hardwallet/verify-pin {:pin pin
:pairing pairing}} :pairing pairing}}
(fx/merge cofx (fx/merge cofx
{:db (assoc-in db [:hardwallet :on-card-connected] :hardwallet/verify-pin)} {:db (assoc-in db [:hardwallet :on-card-connected] :hardwallet/verify-pin)}
(navigation/navigate-to-cofx :hardwallet-connect-settings nil))))) (navigation/navigate-to-cofx (if setup?
:hardwallet-connect
:hardwallet-connect-settings) nil)))))
(defn- unblock-pin (defn- unblock-pin
[{:keys [db] :as cofx}] [{:keys [db] :as cofx}]

View File

@ -59,7 +59,8 @@
(letsubs [{:keys [photo-path name error processing save-password? can-save-password?]} [:accounts/login] (letsubs [{:keys [photo-path name error processing save-password? can-save-password?]} [:accounts/login]
can-navigate-back? [:can-navigate-back?] can-navigate-back? [:can-navigate-back?]
password-text-input (atom nil) password-text-input (atom nil)
sign-in-enabled? [:sign-in-enabled?]] sign-in-enabled? [:sign-in-enabled?]
view-id [:view-id]]
[react/keyboard-avoiding-view {:style ast/accounts-view} [react/keyboard-avoiding-view {:style ast/accounts-view}
[status-bar/status-bar] [status-bar/status-bar]
[login-toolbar can-navigate-back?] [login-toolbar can-navigate-back?]
@ -72,7 +73,7 @@
{:label (i18n/label :t/password) {:label (i18n/label :t/password)
:placeholder (i18n/label :t/password) :placeholder (i18n/label :t/password)
:ref #(reset! password-text-input %) :ref #(reset! password-text-input %)
:auto-focus true :auto-focus (= view-id :login)
:on-submit-editing (when sign-in-enabled? :on-submit-editing (when sign-in-enabled?
#(login-account @password-text-input)) #(login-account @password-text-input))
:on-change-text #(do :on-change-text #(do

View File

@ -73,8 +73,10 @@
[react/text {:style styles/maintain-card-second-step-text} [react/text {:style styles/maintain-card-second-step-text}
(str second-number ". " (i18n/label second-label))]) (str second-number ". " (i18n/label second-label))])
(when third-label (when third-label
[react/text {:style styles/maintain-card-third-step-text} [react/view {:flex 1}
(str third-number ". " (i18n/label third-label))])] [react/text {:style styles/maintain-card-third-step-text
:number-of-lines 1}
(str third-number ". " (i18n/label third-label))]])]
[react/text {:style styles/maintain-card-text [react/text {:style styles/maintain-card-text
:number-of-lines 2} :number-of-lines 2}
(i18n/label :t/maintain-card-to-phone-contact)]))) (i18n/label :t/maintain-card-to-phone-contact)])))

View File

@ -37,8 +37,8 @@
:flex 1 :flex 1
:width "95%" :width "95%"
:background-color :white :background-color :white
:padding-left 20 :padding-left 10
:margin-right 20}) :margin-right 10})
(def maintain-card-current-step-text (def maintain-card-current-step-text
{:typography :caption {:typography :caption

View File

@ -222,10 +222,19 @@
(display-recovery-phrase) (display-recovery-phrase)
(enter-recovery-phrase)))) (enter-recovery-phrase))))
(defview enter-pair-code-input [ref]
{:component-will-update #(.clear @ref)}
[text-input/text-input-with-label
{:on-change-text #(re-frame/dispatch [:hardwallet.ui/pair-code-input-changed %])
:auto-focus true
:ref (partial reset! ref)
:placeholder ""}])
(defview enter-pair-code [] (defview enter-pair-code []
(letsubs [pair-code [:hardwallet-pair-code] (letsubs [pair-code [:hardwallet-pair-code]
error [:hardwallet-setup-error] error [:hardwallet-setup-error]
width [:dimensions/window-width]] width [:dimensions/window-width]
ref (atom nil)]
[react/scroll-view [react/scroll-view
[react/view styles/enter-pair-code-container [react/view styles/enter-pair-code-container
[react/view styles/enter-pair-code-title-container [react/view styles/enter-pair-code-title-container
@ -241,9 +250,7 @@
:color colors/red}} :color colors/red}}
error]]) error]])
[react/view (styles/enter-pair-code-input-container width) [react/view (styles/enter-pair-code-input-container width)
[text-input/text-input-with-label [enter-pair-code-input ref]]]
{:on-change-text #(re-frame/dispatch [:hardwallet.ui/pair-code-input-changed %])
:placeholder ""}]]]
[react/view styles/next-button-container [react/view styles/next-button-container
[react/view components.styles/flex] [react/view components.styles/flex]
[react/view {:margin-right 20} [react/view {:margin-right 20}