[#9345] fix some issues on keycard login screen
This commit is contained in:
parent
40ca4af6a6
commit
f8c761a40e
|
@ -20,7 +20,8 @@
|
|||
status-im.hardwallet.fx
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]))
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.ui.components.bottom-sheet.core :as bottom-sheet]))
|
||||
|
||||
(def default-pin "000000")
|
||||
|
||||
|
@ -497,13 +498,12 @@
|
|||
(navigation/navigate-to-cofx :keycard-recovery-enter-mnemonic nil)))
|
||||
|
||||
(fx/defn start-import-flow
|
||||
{:events [::recover-with-keycard-pressed
|
||||
:keycard.login.ui/recover-key-pressed]}
|
||||
{:events [::recover-with-keycard-pressed]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(fx/merge cofx
|
||||
{:db (assoc-in db [:hardwallet :flow] :import)
|
||||
:dispatch [:bottom-sheet/hide-sheet]
|
||||
:hardwallet/check-nfc-enabled nil}
|
||||
(bottom-sheet/hide-bottom-sheet)
|
||||
(navigation/navigate-to-cofx :keycard-recovery-intro nil)))
|
||||
|
||||
(fx/defn access-key-pressed
|
||||
|
@ -775,22 +775,19 @@
|
|||
(fx/defn login-pin-more-icon-pressed
|
||||
{:events [:keycard.login.pin.ui/more-icon-pressed]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(fx/merge cofx
|
||||
{:dispatch [:bottom-sheet/show-sheet :keycard.login/more {}]}))
|
||||
(bottom-sheet/show-bottom-sheet cofx {:view :keycard.login/more}))
|
||||
|
||||
(fx/defn login-create-key-pressed
|
||||
{:events [:keycard.login.ui/create-new-key-pressed]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(fx/merge cofx
|
||||
{:dispatch [:bottom-sheet/hide-sheet]}
|
||||
(bottom-sheet/hide-bottom-sheet)
|
||||
(start-onboarding-flow)))
|
||||
|
||||
(fx/defn login-add-key-pressed
|
||||
{:events [:keycard.login.ui/add-key-pressed]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(fx/merge cofx
|
||||
{:dispatch [:bottom-sheet/hide-sheet]}
|
||||
(start-import-flow)))
|
||||
(start-import-flow cofx))
|
||||
|
||||
(fx/defn login-remember-me-changed
|
||||
{:events [:keycard.login.ui/remember-me-changed]}
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
[status-im.utils.signing-phrase.core :as signing-phrase]
|
||||
[status-im.utils.types :as types]
|
||||
[status-im.utils.utils :as utils]
|
||||
[status-im.utils.platform :as platform]))
|
||||
[status-im.utils.platform :as platform]
|
||||
[status-im.ui.components.bottom-sheet.core :as bottom-sheet]))
|
||||
|
||||
(def step-kw-to-num
|
||||
{:generate-key 1
|
||||
|
@ -51,18 +52,31 @@
|
|||
{:keys [address]} (get-selected-multiaccount cofx)
|
||||
hashed-password (ethereum/sha3 (security/safe-unmask-data key-code))
|
||||
callback #(re-frame/dispatch [::store-multiaccount-success key-code %])]
|
||||
(log/debug "create-multiaccount")
|
||||
{::store-multiaccount [selected-id address hashed-password callback]}))
|
||||
|
||||
(fx/defn prepare-intro-wizard
|
||||
[{:keys [db] :as cofx} first-time-setup?]
|
||||
{:db (assoc db :intro-wizard {:step :generate-key
|
||||
:weak-password? true
|
||||
:back-action :intro-wizard/navigate-back
|
||||
:forward-action :intro-wizard/step-forward-pressed
|
||||
:encrypt-with-password? true
|
||||
:first-time-setup? first-time-setup?})})
|
||||
|
||||
(fx/defn intro-wizard
|
||||
{:events [:multiaccounts.create.ui/intro-wizard]}
|
||||
[{:keys [db] :as cofx} first-time-setup?]
|
||||
(fx/merge cofx
|
||||
{:db (assoc db :intro-wizard {:step :generate-key
|
||||
:weak-password? true
|
||||
:back-action :intro-wizard/navigate-back
|
||||
:forward-action :intro-wizard/step-forward-pressed
|
||||
:encrypt-with-password? true
|
||||
:first-time-setup? first-time-setup?})}
|
||||
(prepare-intro-wizard first-time-setup?)
|
||||
(navigation/navigate-to-cofx :create-multiaccount-generate-key nil)))
|
||||
|
||||
(fx/defn get-new-key
|
||||
{:events [:multiaccounts.create.ui/get-new-key]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(fx/merge cofx
|
||||
(prepare-intro-wizard false)
|
||||
(bottom-sheet/hide-bottom-sheet)
|
||||
(navigation/navigate-to-cofx :create-multiaccount-generate-key nil)))
|
||||
|
||||
(fx/defn dec-step
|
||||
|
@ -128,20 +142,19 @@
|
|||
(cond (confirm-failure? db)
|
||||
(on-confirm-failure cofx)
|
||||
|
||||
(and (= step :confirm-code)
|
||||
(:multiaccounts/login db))
|
||||
(exit-wizard cofx)
|
||||
|
||||
(= step :generate-key)
|
||||
(init-key-generation cofx)
|
||||
|
||||
(and (= step :confirm-code)
|
||||
(not (:multiaccounts/login db))
|
||||
(not processing?))
|
||||
(fx/merge cofx
|
||||
{:db (assoc-in db [:intro-wizard :processing?] true)}
|
||||
create-multiaccount)
|
||||
|
||||
(and (= step :confirm-code)
|
||||
(:multiaccounts/login db))
|
||||
(exit-wizard cofx)
|
||||
|
||||
(and (= step :select-key-storage)
|
||||
(= :advanced selected-storage-type))
|
||||
{:dispatch [:keycard/start-onboarding-flow]}
|
||||
|
|
|
@ -376,9 +376,7 @@
|
|||
[toolbar/nav-button
|
||||
(actions/back
|
||||
#(re-frame/dispatch [:keycard.login.pin.ui/cancel-pressed]))])
|
||||
[react/text {:style {:color colors/gray}}
|
||||
(i18n/label :t/step-i-of-n {:number 2
|
||||
:step 1})]
|
||||
nil
|
||||
[react/view {:margin-right 20}
|
||||
[react/touchable-highlight
|
||||
{:on-press #(re-frame/dispatch [:keycard.login.pin.ui/more-icon-pressed])}
|
||||
|
@ -441,7 +439,7 @@
|
|||
:step enter-step}]
|
||||
[react/view {:margin-bottom (if small-screen? 25 32)}
|
||||
[react/touchable-highlight
|
||||
{:on-press #(re-frame/dispatch [:keycard.login.ui/recover-key-pressed])}
|
||||
{:on-press #(re-frame/dispatch [:multiaccounts.recover.ui/recover-multiaccount-button-pressed])}
|
||||
[react/text {:style {:color colors/blue}}
|
||||
(i18n/label :t/recover-key)]]]]]))
|
||||
|
||||
|
@ -530,21 +528,13 @@
|
|||
:animating true}])]]])))
|
||||
|
||||
(defn- more-sheet-content []
|
||||
[react/view {:flex 1
|
||||
:flex-direction :row
|
||||
:margin-top 18}
|
||||
[react/view {:flex 1}
|
||||
[list-item/list-item
|
||||
{:theme :action
|
||||
:title :t/create-new-key
|
||||
:icon :main-icons/profile
|
||||
:on-press #(re-frame/dispatch [:keycard.login.ui/create-new-key-pressed])}]
|
||||
[list-item/list-item
|
||||
{:theme :action
|
||||
:title :t/add-another-key
|
||||
:icon :main-icons/add
|
||||
:on-press #(re-frame/dispatch [:keycard.login.ui/add-key-pressed])}]]])
|
||||
[react/view {:flex 1}
|
||||
[list-item/list-item
|
||||
{:theme :action
|
||||
:title :t/create-new-key
|
||||
:icon :main-icons/profile
|
||||
:on-press #(re-frame/dispatch [:multiaccounts.create.ui/get-new-key])}]])
|
||||
|
||||
(def more-sheet
|
||||
{:content more-sheet-content
|
||||
:content-height 149})
|
||||
:content-height 65})
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
"create-a-pin": "Create a 6-digit passcode",
|
||||
"create-group-chat": "Create group chat",
|
||||
"create-multiaccount": "Create multiaccount",
|
||||
"create-new-key": "Create a new key",
|
||||
"create-new-key": "Get a new key",
|
||||
"create-pin": "Create 6-digit passcode",
|
||||
"create-pin-description": "You'll need your card + this 6-digit passcode to unlock Status and to confirm transactions",
|
||||
"created-group-chat-description": "You created the group {{group-name}}",
|
||||
|
|
Loading…
Reference in New Issue