From c25f44c2a08719a75f4cfdb9588d8e72f6472252 Mon Sep 17 00:00:00 2001 From: Jamie Caprani Date: Tue, 5 Dec 2023 14:35:27 +0000 Subject: [PATCH] chore: make new wallet UI default, move set currency to legacy settings, remove add eth network on wallet init (#18027) --- .../ui/screens/advanced_settings/views.cljs | 13 +++++++++++- src/status_im/wallet/core.cljs | 20 +------------------ .../contexts/shell/jump_to/state.cljs | 3 +-- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/status_im/ui/screens/advanced_settings/views.cljs b/src/status_im/ui/screens/advanced_settings/views.cljs index 3a70aa54d20..a4324d51742 100644 --- a/src/status_im/ui/screens/advanced_settings/views.cljs +++ b/src/status_im/ui/screens/advanced_settings/views.cljs @@ -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] diff --git a/src/status_im/wallet/core.cljs b/src/status_im/wallet/core.cljs index 35697f44b19..5844fe978f7 100644 --- a/src/status_im/wallet/core.cljs +++ b/src/status_im/wallet/core.cljs @@ -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" diff --git a/src/status_im2/contexts/shell/jump_to/state.cljs b/src/status_im2/contexts/shell/jump_to/state.cljs index d327e5d9f88..42b7f2dbdbd 100644 --- a/src/status_im2/contexts/shell/jump_to/state.cljs +++ b/src/status_im2/contexts/shell/jump_to/state.cljs @@ -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))