-
Notifications
You must be signed in to change notification settings - Fork 195
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
refactor: store currency rate in settings ref #1645
Conversation
🚀 Thanks for the pull request! Here are the current build files for testing: Download and unzip the file for your browser. Refer to the readme for detailed install instructions. This build is brought to you by:
Want to sponsor the next build? send some sats to ⚡️builds@getalby.com (don't forget to provide your name) Don't forget: keep earning sats! |
ups merged this other PR. sorry for the conflict |
3f02c63
to
7f167d8
Compare
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.
Awesome, thanks Lisa! Kinda missed the promises :P
@escapedcat Please review again. I added a try/catch block too and opened a ticket for a found bug |
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.
Right, some do not support certain currencies? Thanks!
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.
why do we need the await her now again? because now we load the rate always when we do getFiatValue
and in getCurrencyRate
we check if it is already loaded, if nowt we load it throuh the api.getCurrencyRate()
call?
correct?
As discussed. This can be merged |
Describe the changes you have made in this PR
This is a refactoring which resulted from out the discussion in PR #1614
getFiatValue
is called => always check if the currency in the state matches with the currency in the ref, and update otherwisegetFiatValue
in a try/catch block and display an error when a sat to fiat conversion failedUnfortunately this reverted a few commits from this PR again (sorry @escapedcat 🌷 )
FIXES
Screenshots
Try/Catch Toast Error
Link this PR to an issue [optional]
Fixes #1608
Type of change
fix
: Bug fix (non-breaking change which fixes an issue)How has this been tested?
AccountMenu
renders the fiatValueChecklist