Skip to content

Commit

Permalink
feat: return to page 1 when clearing variant filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeluigi committed Oct 20, 2024
1 parent 75ee7f6 commit 1c6efec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ const Search: React.FC<Props> = ({ combos, count, page, bannedCombos, error, fea
};

const handleGroupByComboChange = (value: string) => {
router.push({ pathname: '/search/', query: { ...router.query, groupByCombo: value } });
router.push({ pathname: '/search/', query: { ...router.query, groupByCombo: value, page: '1' } });
};

const handleClearVariant = () => {
router.push({ pathname: '/search/', query: { ...router.query, variant: undefined } });
router.push({ pathname: '/search/', query: { ...router.query, variant: undefined, page: '1' } });
};

const legalityMessage = doesQuerySpecifyFormat(query) ? '' : ' (legal:commander has been applied by default)';
Expand Down

0 comments on commit 1c6efec

Please sign in to comment.