Fix: Remove CLNY from currency list and add try catch for CoinGecko errors #3961
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses mainly the problem of having the
CLNY
token migrated to another address onArbitrum One
.This caused the
fetchTokenPriceByAddress
to throw an error and render theBalances
page blank, due to a missingtry...catch
block.Also given that for the moment we don't have data based on which to convert amounts to
CLNY
, we'll hide the option from the user menu, while also refreshing thepreferredCurrency
stored in the user profile.Testing
TODO: Let's test our changes do work as expected.
line 55
insrc/components/shared/CurrencyConversion/CurrencyConversion.tsx
and comment also
line 79
insrc/utils/currency/currency.ts
// if (isDev) return 1;
Step 2. Now go to http://localhost:9091/planex/balances
You should see this error in the console, but the page should have no issue rendering.
Step 3. Awesome ✨ Now let's test the
CLNY
currency selection. Please comment the36-39 lines
insrc/components/common/Extensions/UserNavigation/partials/UserSubmenu/partials/Currency/Currency.tsx
CLNY
token should be again visible in the user menu listCLNY
but remain as previously selected.Screen.Recording.2024-12-17.at.19.29.47.mov
CLNY
CLNY
already stored in the user profile's preferredCurrency.First, let's manually update the localStorage
preferredCurrency
entry toCLNY
Now, please run the following mutation
Screen.Recording.2024-12-17.at.19.39.43.mov
preferredCurrency
is set to another value thanCLNY
Screen.Recording.2024-12-17.at.21.33.44.mov
If you've reached so far, I can confirm your testing is completed, though feel free to explore any other scenario that comes in mind. 🎉
Diffs
Changes 🏗
SupportedCurrencies.Clny
is not used ftm.try...catch
Resolves #3965