-
Notifications
You must be signed in to change notification settings - Fork 984
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
[wallet] Show cached balance before fetching latest #12134
Conversation
Jenkins BuildsClick to see older builds (12)
|
7726136
to
f2863bf
Compare
src/status_im/wallet/core.cljs
Outdated
|
||
(fx/defn get-balances | ||
[{:keys [db]} addresses] | ||
(if (nil? (get-in db [:wallet :accounts])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you elaborate on why do we check :accounts ? and not like for example that balances are nil? are we sure that accounts will be always nil here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only makes sense to retrieve cached balances when we log into the app and this specific check will be true only when called from ::initialize-wallet
https://github.com/status-im/status-react/blob/wallet%2Fcached-eth-balance/src/status_im/multiaccounts/login/core.cljs#L99. In this case yes, I'm sure it will be nil
when needed. With balances it is a bit different because those might be nil
for a newly created accounts but it wouldn't make sense to check cache for those.
But I agree it might look weird so I will rewrite it with an explicit request for cached balances from ::initialize-wallet
instead of making it implicit inside wallet/update-balances
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flexsurfer fixed
97% of end-end tests have passed
Failed tests (2)Click to expand
Passed tests (68)Click to expand |
f2863bf
to
9b7a6f0
Compare
50% of end-end tests have passed
Failed tests (1)Click to expand
Passed tests (1)Click to expand
|
100% of end-end tests have passed
Passed tests (1)Click to expand
|
6c56883
to
fff31e3
Compare
fff31e3
to
58d3581
Compare
status: ready