From a88687dfe8f92dedbb2d55c5fdb4a19fe986ef58 Mon Sep 17 00:00:00 2001 From: Tom Jeatt Date: Wed, 27 Sep 2023 08:19:30 +0100 Subject: [PATCH] fix: allow CoinGecko id to be undefined --- src/hooks/api/use-get-prices.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/hooks/api/use-get-prices.tsx b/src/hooks/api/use-get-prices.tsx index 8cacd07989..b8c9302c67 100644 --- a/src/hooks/api/use-get-prices.tsx +++ b/src/hooks/api/use-get-prices.tsx @@ -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]; @@ -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;