Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Wallet Home jumping #20347

Merged
merged 8 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/quo/components/wallet/wallet_overview/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
(:require
[quo.foundations.colors :as colors]))

(def container-info
(defn container-info
[{:keys [metrics]}]
{:padding-horizontal 20
:padding-top 12
:padding-bottom 32
:flex-grow 1
:max-height 98})
:height (if (= metrics :none) 78 98)})
ulisesmac marked this conversation as resolved.
Show resolved Hide resolved

(def container-info-top
{:flex-direction :row
Expand Down
2 changes: 1 addition & 1 deletion src/quo/components/wallet/wallet_overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

(defn- view-internal
[props]
[rn/view {:style style/container-info}
[rn/view {:style (style/container-info props)}
[view-info-top props]
[view-info-bottom props]])

Expand Down
2 changes: 1 addition & 1 deletion src/status_im/contexts/profile/login/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
:on-error #(log/error "failed to start messenger" %)}]]
[:dispatch [:universal-links/generate-profile-url]]
[:dispatch [:community/fetch]]
[:dispatch [:wallet/initialize]]
[:push-notifications/load-preferences]
[:profile.config/get-node-config]
[:logs/set-level log-level]
Expand Down Expand Up @@ -145,6 +144,7 @@
(when (and new-account? (not recovered-account?))
[:dispatch [:wallet-legacy/set-initial-blocks-range]])
[:dispatch [:ens/update-usernames ensUsernames]]
[:dispatch [:wallet/initialize]]
OmarBasem marked this conversation as resolved.
Show resolved Hide resolved
[:dispatch [:profile.login/login-existing-profile settings account]]]})))

(rf/reg-event-fx
Expand Down
3 changes: 2 additions & 1 deletion src/status_im/contexts/wallet/db.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
:selected-networks (set constants/default-network-names)})

(def defaults
{:ui {:network-filter network-filter-defaults}})
{:ui {:network-filter network-filter-defaults
:tokens-loading {}}})
13 changes: 8 additions & 5 deletions src/status_im/subs/wallet/wallet.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@
:wallet/home-tokens-loading?
:<- [:wallet/tokens-loading]
(fn [tokens-loading]
(->> tokens-loading
vals
(some true?)
boolean)))
(if (empty? tokens-loading)
true
(->> tokens-loading
vals
(some true?)
boolean))))

(rf/reg-sub
:wallet/current-viewing-account-tokens-loading?
Expand Down Expand Up @@ -335,7 +337,8 @@
:customization-color color
:type (if watch-only? :watch-only :empty)
: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))))
accounts)))

Expand Down