Skip to content

Commit

Permalink
3008: Fix flash of no results found
Browse files Browse the repository at this point in the history
  • Loading branch information
LeandraH committed Dec 5, 2024
1 parent 27637bd commit 61218d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/src/routes/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ const SearchPage = ({ city, cityCode, languageCode, pathname }: CityRouteProps):
if (query.length === 0) {
return null
}
if (loading || allPossibleResults.length === 0) {
if (loading || !results) {
return <LoadingSpinner />
}
return (
<>
<List>
<SearchCounter>{t('searchResultsCount', { count: results?.length ?? 0 })}</SearchCounter>
{results?.map(({ title, content, path, thumbnail }) => (
<SearchCounter>{t('searchResultsCount', { count: results.length })}</SearchCounter>
{results.map(({ title, content, path, thumbnail }) => (
<SearchListItem
title={title}
contentWithoutHtml={parseHTML(content)}
Expand All @@ -104,7 +104,7 @@ const SearchPage = ({ city, cityCode, languageCode, pathname }: CityRouteProps):
<SearchFeedback
cityCode={cityCode}
languageCode={languageCode}
noResults={results?.length === 0}
noResults={results.length === 0}
query={filterText}
/>
</>
Expand Down

0 comments on commit 61218d3

Please sign in to comment.