Skip to content

Commit

Permalink
fix default chain logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tienkane committed Dec 12, 2024
1 parent 7cfb140 commit 706e69a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/Earns/PoolExplorer/useFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 706e69a

Please sign in to comment.