From: SleeplessOne1917 Date: Thu, 4 May 2023 01:47:37 +0000 (+0000) Subject: Get rid of "No Results" showing while search is still loading. (#997) X-Git-Url: http://these/git/%22%7Burl%7D/%22https:/image.com/%7B%60%24%7BghostArchiveUrl%7D/%7BcommunityRss%7D?a=commitdiff_plain;h=a027595eaaf649defae6ea1b83e9a0a7767de7bd;p=lemmy-ui.git Get rid of "No Results" showing while search is still loading. (#997) --- diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx index 53b56e8..946dd6a 100644 --- a/src/shared/components/search.tsx +++ b/src/shared/components/search.tsx @@ -423,7 +423,9 @@ export class Search extends Component { {this.selects} {this.searchForm} {this.displayResults(type)} - {this.resultsCount === 0 && {i18n.t("no_results")}} + {this.resultsCount === 0 && !this.state.searchLoading && ( + {i18n.t("no_results")} + )} ); @@ -1002,7 +1004,7 @@ export class Search extends Component { } checkFinishedLoading() { - if (this.state.searchResponse && this.state.resolveObjectResponse) { + if (this.state.searchResponse || this.state.resolveObjectResponse) { this.setState({ searchLoading: false }); } }