Skip to content

Commit

Permalink
fix(mentions): Rewrite URL on tab change
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Oct 24, 2024
1 parent 176a798 commit 9ed5162
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/pages/mentions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ export default function Mentions() {
searchParams.set('search', search);
setSearchParams(searchParams);
};
const onTabChange = (i) => {
searchParams.set('type', i === 0 ? 'software' : 'datasets');
setSearchParams(searchParams);
};

// Effects
useEffect(() => {
Expand Down Expand Up @@ -400,10 +404,7 @@ export default function Mentions() {
</Modal>
<Tabs
defaultActiveIndex={0}
onTabChange={(i) => setUrlSearchParams({
...urlSearchParams,
type: i === 0 ? 'software' : 'datasets',
})}
onTabChange={(i) => onTabChange(i)}
>
<Tab label="Software">
<DataTable
Expand Down

0 comments on commit 9ed5162

Please sign in to comment.