diff --git a/web/components/contract-search.tsx b/web/components/contract-search.tsx index 11d65a13..ebcba985 100644 --- a/web/components/contract-search.tsx +++ b/web/components/contract-search.tsx @@ -91,6 +91,7 @@ export function ContractSearch(props: { headerClassName?: string useQuerySortLocalStorage?: boolean useQuerySortUrlParams?: boolean + isWholePage?: boolean }) { const { user, @@ -105,6 +106,7 @@ export function ContractSearch(props: { headerClassName, useQuerySortLocalStorage, useQuerySortUrlParams, + isWholePage, } = props const [numPages, setNumPages] = useState(1) @@ -139,7 +141,7 @@ export function ContractSearch(props: { setNumPages(results.nbPages) if (freshQuery) { setPages([newPage]) - window.scrollTo(0, 0) + if (isWholePage) window.scrollTo(0, 0) } else { setPages((pages) => [...pages, newPage]) } diff --git a/web/pages/home.tsx b/web/pages/home.tsx index 8153baea..e61d5c32 100644 --- a/web/pages/home.tsx +++ b/web/pages/home.tsx @@ -45,6 +45,7 @@ const Home = (props: { auth: { user: User } | null }) => { // Update the url without switching pages in Nextjs. history.pushState(null, '', `/${c.creatorUsername}/${c.slug}`) }} + isWholePage />