Skip to content

Commit

Permalink
fix: allow CoinGecko id to be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeatt committed Sep 27, 2023
1 parent b687534 commit a88687d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hooks/api/use-get-prices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useGetCurrencies } from './use-get-currencies';
// MEMO: Returns `undefined` for currencies without coingecko ID.
const getCoingeckoId = (currency: CurrencyExt) => {
if (isForeignAsset(currency)) {
console.log('currency', currency.foreignAsset);
return currency.foreignAsset.coingeckoId;
}
return COINGECKO_ID_BY_CURRENCY_TICKER[currency.ticker];
Expand All @@ -22,9 +23,6 @@ const getCoingeckoId = (currency: CurrencyExt) => {
const composeIds = (currencies: CurrencyExt[]): string =>
currencies.reduce((acc, currency) => {
const coingeckoId = getCoingeckoId(currency);
if (!coingeckoId) {
return acc;
}

if (!acc) {
return coingeckoId;
Expand Down

0 comments on commit a88687d

Please sign in to comment.