diff --git a/src/components/Tokens/TokenDetails/ChartSection.tsx b/src/components/Tokens/TokenDetails/ChartSection.tsx index 2079d0a32f..0a585dc136 100644 --- a/src/components/Tokens/TokenDetails/ChartSection.tsx +++ b/src/components/Tokens/TokenDetails/ChartSection.tsx @@ -82,7 +82,7 @@ export default function ChartSection({ const isFavorited = useIsFavorited(token.address) const toggleFavorite = useToggleFavorite(token.address) const chainId = CHAIN_NAME_TO_CHAIN_ID[token.chain] - const L2Icon = getChainInfo(chainId).circleLogoUrl + const L2Icon = getChainInfo(chainId)?.circleLogoUrl const warning = checkWarning(token.address ?? '') const timePeriod = useAtomValue(filterTimeAtom) diff --git a/src/components/Tokens/TokenTable/TokenRow.tsx b/src/components/Tokens/TokenTable/TokenRow.tsx index 4735924855..e182f7e21d 100644 --- a/src/components/Tokens/TokenTable/TokenRow.tsx +++ b/src/components/Tokens/TokenTable/TokenRow.tsx @@ -483,7 +483,7 @@ export const LoadedRow = forwardRef((props: LoadedRowProps, ref: ForwardedRef().chainName?.toUpperCase() ?? 'ethereum' const filterNetwork = lowercaseChainName.toUpperCase() - const L2Icon = getChainInfo(CHAIN_NAME_TO_CHAIN_ID[filterNetwork]).circleLogoUrl + const L2Icon = getChainInfo(CHAIN_NAME_TO_CHAIN_ID[filterNetwork])?.circleLogoUrl const timePeriod = useAtomValue(filterTimeAtom) const delta = token.market?.pricePercentChange?.value const arrow = getDeltaArrow(delta) diff --git a/src/graphql/data/fetchGraphQL.ts b/src/graphql/data/fetchGraphQL.ts index 1cec9040aa..ecece12a42 100644 --- a/src/graphql/data/fetchGraphQL.ts +++ b/src/graphql/data/fetchGraphQL.ts @@ -16,7 +16,12 @@ const fetchQuery = (params: RequestParameters, variables: Variables): Promise res.json()) + return fetch(URL, { method: 'POST', body, headers }) + .then((res) => res.json()) + .catch((e) => { + console.error(e) + return { data: [] } + }) } export default fetchQuery