Skip to content

Commit

Permalink
feat(download): used the size for the search params in the download b…
Browse files Browse the repository at this point in the history
…utton when it's present
  • Loading branch information
ClementDreptin committed Aug 10, 2023
1 parent 05a883b commit 761905d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/[locale]/(search)/results/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const ResultsPage: Page = async ({
}) => {
const searchParams = useSearchParams(nextSearchParams);
const queryString = searchParams.getQueryString();
const size = searchParams.getSize();

if (queryString === "") {
redirect("/");
Expand All @@ -77,7 +78,7 @@ const ResultsPage: Page = async ({
))}
</ResultsGrid>

<DownloadButton size={results.total} />
<DownloadButton size={size !== 0 ? size : results.total} />
</>
);
} catch (error) {
Expand Down

0 comments on commit 761905d

Please sign in to comment.