From 706e69afaa361f605fcbd1824215de7246707500 Mon Sep 17 00:00:00 2001 From: Tien Nguyen Date: Thu, 12 Dec 2024 14:14:09 +0700 Subject: [PATCH] fix default chain logic --- src/pages/Earns/PoolExplorer/useFilter.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/Earns/PoolExplorer/useFilter.ts b/src/pages/Earns/PoolExplorer/useFilter.ts index cab936c3b5..5839f6858a 100644 --- a/src/pages/Earns/PoolExplorer/useFilter.ts +++ b/src/pages/Earns/PoolExplorer/useFilter.ts @@ -8,13 +8,17 @@ import { Direction } from 'pages/MarketOverview/SortIcon' import { FilterTag, SortBy, timings } from '.' +const supportedChains = [ChainId.MAINNET, ChainId.BASE] + export default function useFilter(setSearch?: (search: string) => void) { const [searchParams, setSearchParams] = useSearchParams() const { account, chainId } = useActiveWeb3React() const filters: QueryParams = useMemo(() => { return { - chainId: +(searchParams.get('chainId') || chainId || ChainId.MAINNET), + chainId: +( + searchParams.get('chainId') || (chainId && supportedChains.includes(chainId) ? chainId : ChainId.MAINNET) + ), page: +(searchParams.get('page') || 1), limit: 10, interval: searchParams.get('interval') || (timings[0].value as string),