diff --git a/src/state/lists/hooks.ts b/src/state/lists/hooks.ts index 796e1438ef..e5589b41ae 100644 --- a/src/state/lists/hooks.ts +++ b/src/state/lists/hooks.ts @@ -103,10 +103,8 @@ function combineMaps(map1: TokenAddressMap, map2: TokenAddressMap): TokenAddress // merge tokens contained within lists from urls function useCombinedTokenMapFromUrls(urls: string[] | undefined): TokenAddressMap { const lists = useAllLists() - return useMemo(() => { if (!urls) return EMPTY_LIST - return ( urls .slice() diff --git a/src/state/lists/updater.ts b/src/state/lists/updater.ts index 1f2ac60324..e1d9eb1d4f 100644 --- a/src/state/lists/updater.ts +++ b/src/state/lists/updater.ts @@ -7,7 +7,7 @@ import { useFetchListCallback } from '../../hooks/useFetchListCallback' import useInterval from '../../hooks/useInterval' import useIsWindowVisible from '../../hooks/useIsWindowVisible' import { AppDispatch } from '../index' -import { acceptListUpdate } from './actions' +import { acceptListUpdate, removeList } from './actions' import { useActiveListUrls } from './hooks' import { useAllInactiveTokens } from 'hooks/Tokens' import { UNSUPPORTED_LIST_URLS } from 'constants/lists' @@ -35,6 +35,13 @@ export default function Updater(): null { // fetch all lists every 10 minutes, but only after we initialize library useInterval(fetchAllListsCallback, library ? 1000 * 60 * 10 : null) + // hot fix for fetching error + useEffect(() => { + if (lists['https://tokens.coingecko.com/uniswap/all.json']) { + dispatch(removeList('https://tokens.coingecko.com/uniswap/all.json')) + } + }, [dispatch, lists]) + // whenever a list is not loaded and not loading, try again to load it useEffect(() => { Object.keys(lists).forEach(listUrl => {