fix(wallet): Wallet Home jumping (#20347)
This commit is contained in:
parent
686f6bdf5e
commit
6a3794f380
|
@ -2,12 +2,13 @@
|
||||||
(:require
|
(:require
|
||||||
[quo.foundations.colors :as colors]))
|
[quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
(def container-info
|
(defn container-info
|
||||||
|
[{:keys [metrics]}]
|
||||||
{:padding-horizontal 20
|
{:padding-horizontal 20
|
||||||
:padding-top 12
|
:padding-top 12
|
||||||
:padding-bottom 32
|
:padding-bottom 32
|
||||||
:flex-grow 1
|
:flex-grow 1
|
||||||
:max-height 98})
|
:height (if (= metrics :none) 78 98)})
|
||||||
|
|
||||||
(def container-info-top
|
(def container-info-top
|
||||||
{:flex-direction :row
|
{:flex-direction :row
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
|
|
||||||
(defn- view-internal
|
(defn- view-internal
|
||||||
[props]
|
[props]
|
||||||
[rn/view {:style style/container-info}
|
[rn/view {:style (style/container-info props)}
|
||||||
[view-info-top props]
|
[view-info-top props]
|
||||||
[view-info-bottom props]])
|
[view-info-bottom props]])
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@
|
||||||
:on-error #(log/error "failed to start messenger" %)}]]
|
:on-error #(log/error "failed to start messenger" %)}]]
|
||||||
[:dispatch [:universal-links/generate-profile-url]]
|
[:dispatch [:universal-links/generate-profile-url]]
|
||||||
[:dispatch [:community/fetch]]
|
[:dispatch [:community/fetch]]
|
||||||
[:dispatch [:wallet/initialize]]
|
|
||||||
[:push-notifications/load-preferences]
|
[:push-notifications/load-preferences]
|
||||||
[:profile.config/get-node-config]
|
[:profile.config/get-node-config]
|
||||||
[:logs/set-level log-level]
|
[:logs/set-level log-level]
|
||||||
|
@ -145,6 +144,7 @@
|
||||||
(when (and new-account? (not recovered-account?))
|
(when (and new-account? (not recovered-account?))
|
||||||
[:dispatch [:wallet-legacy/set-initial-blocks-range]])
|
[:dispatch [:wallet-legacy/set-initial-blocks-range]])
|
||||||
[:dispatch [:ens/update-usernames ensUsernames]]
|
[:dispatch [:ens/update-usernames ensUsernames]]
|
||||||
|
[:dispatch [:wallet/initialize]]
|
||||||
[:dispatch [:profile.login/login-existing-profile settings account]]]})))
|
[:dispatch [:profile.login/login-existing-profile settings account]]]})))
|
||||||
|
|
||||||
(rf/reg-event-fx
|
(rf/reg-event-fx
|
||||||
|
|
|
@ -6,4 +6,5 @@
|
||||||
:selected-networks (set constants/default-network-names)})
|
:selected-networks (set constants/default-network-names)})
|
||||||
|
|
||||||
(def defaults
|
(def defaults
|
||||||
{:ui {:network-filter network-filter-defaults}})
|
{:ui {:network-filter network-filter-defaults
|
||||||
|
:tokens-loading {}}})
|
||||||
|
|
|
@ -47,10 +47,12 @@
|
||||||
:wallet/home-tokens-loading?
|
:wallet/home-tokens-loading?
|
||||||
:<- [:wallet/tokens-loading]
|
:<- [:wallet/tokens-loading]
|
||||||
(fn [tokens-loading]
|
(fn [tokens-loading]
|
||||||
(->> tokens-loading
|
(if (empty? tokens-loading)
|
||||||
vals
|
true
|
||||||
(some true?)
|
(->> tokens-loading
|
||||||
boolean)))
|
vals
|
||||||
|
(some true?)
|
||||||
|
boolean))))
|
||||||
|
|
||||||
(rf/reg-sub
|
(rf/reg-sub
|
||||||
:wallet/current-viewing-account-tokens-loading?
|
:wallet/current-viewing-account-tokens-loading?
|
||||||
|
@ -335,7 +337,8 @@
|
||||||
:customization-color color
|
:customization-color color
|
||||||
:type (if watch-only? :watch-only :empty)
|
:type (if watch-only? :watch-only :empty)
|
||||||
:on-press #(rf/dispatch [:wallet/navigate-to-account address])
|
:on-press #(rf/dispatch [:wallet/navigate-to-account address])
|
||||||
:loading? (get tokens-loading address)
|
:loading? (or (get tokens-loading address)
|
||||||
|
(not (contains? tokens-loading address)))
|
||||||
:balance (utils/prettify-balance currency-symbol (get balances address))))
|
:balance (utils/prettify-balance currency-symbol (get balances address))))
|
||||||
accounts)))
|
accounts)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue