chore: make new wallet UI default, move set currency to legacy settings, remove add eth network on wallet init (#18027)

This commit is contained in:
Jamie Caprani 2023-12-05 14:35:27 +00:00 committed by GitHub
parent d039864dca
commit c25f44c2a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 22 deletions

View File

@ -7,6 +7,11 @@
[utils.i18n :as i18n])
(:require-macros [status-im.utils.views :as views]))
(defn hide-sheet-and-dispatch
[event]
(re-frame/dispatch [:bottom-sheet/hide-old])
(re-frame/dispatch event))
(defn- normal-mode-settings-data
[{:keys [network-name
current-log-level
@ -103,7 +108,13 @@
#(re-frame/dispatch
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
:accessory :switch
:active waku-bloom-filter-mode}]))
:active waku-bloom-filter-mode}
{:size :small
:title (i18n/label :t/set-currency)
:accessibility-label :wallet-change-currency
:on-press #(hide-sheet-and-dispatch
[:navigate-to :currency-settings])
:chevron true}]))
(defn- flat-list-data
[options]

View File

@ -1074,7 +1074,7 @@
;;TODO: this could be replaced by a single API call on status-go side
(re-frame/reg-fx :wallet-legacy/initialize-wallet
(fn [[network-id network callback]]
(fn [[network-id _network callback]]
(-> (js/Promise.all
(clj->js
[(js/Promise.
@ -1082,24 +1082,6 @@
(json-rpc/call {:method "accounts_getAccounts"
:on-success resolve-fn
:on-error reject})))
(js/Promise.
(fn [resolve-fn _]
(json-rpc/call
{:method "wallet_addEthereumChain"
:params
[{:isTest false
:tokenOverrides []
:rpcUrl (get-in network [:config :UpstreamConfig :URL])
:chainColor "green"
:chainName (:name network)
:nativeCurrencyDecimals 10
:shortName "erc20"
:layer 1
:chainId (int network-id)
:enabled false
:fallbackURL (get-in network [:config :UpstreamConfig :URL])}]
:on-success resolve-fn
:on-error (fn [_] (resolve-fn nil))})))
(js/Promise.
(fn [resolve-fn _]
(json-rpc/call {:method "wallet_getTokens"

View File

@ -17,6 +17,5 @@
(def load-chats-stack? (reagent/atom false))
(def load-wallet-stack? (reagent/atom false))
(def load-browser-stack? (reagent/atom false))
;NOTE temporary while we support old wallet
(def load-new-wallet? (reagent/atom false))
(def load-new-wallet? (reagent/atom true))