Set initial block range for a newly created account (again)
This commit is contained in:
parent
bad9aa9e20
commit
18347b44fe
|
@ -11,7 +11,6 @@
|
||||||
[status-im2.contexts.profile.config :as profile.config]
|
[status-im2.contexts.profile.config :as profile.config]
|
||||||
[taoensso.timbre :as log]
|
[taoensso.timbre :as log]
|
||||||
[status-im.notifications.core :as notifications]
|
[status-im.notifications.core :as notifications]
|
||||||
[status-im2.contexts.profile.create.events :as profile.create]
|
|
||||||
[status-im2.config :as config]
|
[status-im2.config :as config]
|
||||||
[status-im.data-store.settings :as data-store.settings]
|
[status-im.data-store.settings :as data-store.settings]
|
||||||
[status-im2.contexts.communities.discover.events :as contract-communities]
|
[status-im2.contexts.communities.discover.events :as contract-communities]
|
||||||
|
@ -132,19 +131,17 @@
|
||||||
(switcher-cards-store/fetch-switcher-cards-rpc))))
|
(switcher-cards-store/fetch-switcher-cards-rpc))))
|
||||||
|
|
||||||
(rf/defn login-node-signal
|
(rf/defn login-node-signal
|
||||||
[{{:keys [recovered-account?] :as db} :db :as cofx} {:keys [settings account error]}]
|
[{{:onboarding-2/keys [recovered-account? new-account?] :as db} :db :as cofx}
|
||||||
|
{:keys [settings account error]}]
|
||||||
(log/debug "[signals] node.login" "error" error)
|
(log/debug "[signals] node.login" "error" error)
|
||||||
(if error
|
(if error
|
||||||
{:db (update db :profile/login #(-> % (dissoc :processing) (assoc :error error)))}
|
{:db (update db :profile/login #(-> % (dissoc :processing) (assoc :error error)))}
|
||||||
(let [{:keys [creating?]} (:profile/login db)]
|
(rf/merge cofx
|
||||||
(rf/merge cofx
|
{:db (dissoc db :profile/login)
|
||||||
{:db (dissoc db :profile/login)
|
:dispatch-n [[:logging/initialize-web3-client-version]
|
||||||
:dispatch-n [[:logging/initialize-web3-client-version]
|
(when (and new-account? (not recovered-account?))
|
||||||
(when (and creating? (not recovered-account?))
|
[:wallet/set-initial-blocks-range])]}
|
||||||
[:wallet/set-initial-blocks-range])]}
|
(login-existing-profile settings account))))
|
||||||
(if (or creating? recovered-account?)
|
|
||||||
(profile.create/login-new-profile recovered-account?)
|
|
||||||
(login-existing-profile settings account))))))
|
|
||||||
|
|
||||||
(rf/defn login-with-biometric-if-available
|
(rf/defn login-with-biometric-if-available
|
||||||
{:events [:profile.login/login-with-biometric-if-available]}
|
{:events [:profile.login/login-with-biometric-if-available]}
|
||||||
|
|
|
@ -14,8 +14,11 @@
|
||||||
|
|
||||||
(rf/defn recover-profile-and-login
|
(rf/defn recover-profile-and-login
|
||||||
{:events [:profile.recover/recover-and-login]}
|
{:events [:profile.recover/recover-and-login]}
|
||||||
[_ {:keys [display-name password image-path color seed-phrase]}]
|
[{:keys [db]} {:keys [display-name password image-path color seed-phrase]}]
|
||||||
{::restore-profile-and-login
|
{:db
|
||||||
|
(assoc db :onboarding-2/recovered-account? true)
|
||||||
|
|
||||||
|
::restore-profile-and-login
|
||||||
(merge (profile.config/create)
|
(merge (profile.config/create)
|
||||||
{:displayName display-name
|
{:displayName display-name
|
||||||
:mnemonic (security/safe-unmask-data seed-phrase)
|
:mnemonic (security/safe-unmask-data seed-phrase)
|
||||||
|
|
Loading…
Reference in New Issue