Skip to content

Commit

Permalink
chore: make new wallet UI default, move set currency to legacy settin…
Browse files Browse the repository at this point in the history
…gs, remove add eth network on wallet init (#18027)
  • Loading branch information
J-Son89 authored Dec 5, 2023
1 parent d039864 commit c25f44c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
13 changes: 12 additions & 1 deletion src/status_im/ui/screens/advanced_settings/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
20 changes: 1 addition & 19 deletions src/status_im/wallet/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,32 +1074,14 @@

;;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.
(fn [resolve-fn reject]
(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"
Expand Down
3 changes: 1 addition & 2 deletions src/status_im2/contexts/shell/jump_to/state.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit c25f44c

Please sign in to comment.