diff --git a/src/frontend/next/src/components/SearchResults.tsx b/src/frontend/next/src/components/SearchResults.tsx index 0a7a1809f9..ade73d69a3 100644 --- a/src/frontend/next/src/components/SearchResults.tsx +++ b/src/frontend/next/src/components/SearchResults.tsx @@ -70,6 +70,8 @@ const SearchResults = ({ text, filter }: SearchResultProps) => { } ); const loading = !data && !error; + // search result is empty when the the posts array on the first page is empty + const isEmpty = data?.[0]?.length === 0; if (error) { return ( @@ -100,7 +102,7 @@ const SearchResults = ({ text, filter }: SearchResultProps) => { return ( - {data && data.length ? ( + {!isEmpty ? ( setSize(size + 1)} /> ) : (