Skip to content

Commit

Permalink
fix bug change network but protocol still keep
Browse files Browse the repository at this point in the history
  • Loading branch information
tienkane committed Nov 26, 2024
1 parent f90f24b commit 3993706
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/Earns/PoolExplorer/useFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export default function useFilter() {
const updateFilters = useCallback(
(key: keyof QueryParams, value: string) => {
if (!value) searchParams.delete(key)
else searchParams.set(key, value)
else {
searchParams.set(key, value)
if (key === 'chainId') searchParams.delete('protocol')
}
if (key !== 'sortBy' && key !== 'orderBy' && key !== 'page') searchParams.delete('page')
setSearchParams(searchParams)
},
Expand Down

0 comments on commit 3993706

Please sign in to comment.