Get rid of "No Results" showing while search is still loading. (#997)

This commit is contained in:
SleeplessOne1917 2023-05-04 01:47:37 +00:00 committed by GitHub
parent 70786146d3
commit a027595eaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -423,7 +423,9 @@ export class Search extends Component<any, SearchState> {
{this.selects} {this.selects}
{this.searchForm} {this.searchForm}
{this.displayResults(type)} {this.displayResults(type)}
{this.resultsCount === 0 && <span>{i18n.t("no_results")}</span>} {this.resultsCount === 0 && !this.state.searchLoading && (
<span>{i18n.t("no_results")}</span>
)}
<Paginator page={page} onChange={this.handlePageChange} /> <Paginator page={page} onChange={this.handlePageChange} />
</div> </div>
); );
@ -1002,7 +1004,7 @@ export class Search extends Component<any, SearchState> {
} }
checkFinishedLoading() { checkFinishedLoading() {
if (this.state.searchResponse && this.state.resolveObjectResponse) { if (this.state.searchResponse || this.state.resolveObjectResponse) {
this.setState({ searchLoading: false }); this.setState({ searchLoading: false });
} }
} }