mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-29 15:51:14 +00:00
Get rid of "No Results" showing while search is still loading. (#997)
This commit is contained in:
parent
a2bcc37008
commit
8fe83a2594
1 changed files with 9 additions and 12 deletions
|
@ -368,16 +368,13 @@ export class Search extends Component<any, SearchState> {
|
|||
path={this.context.router.route.match.url}
|
||||
/>
|
||||
<h5>{i18n.t("search")}</h5>
|
||||
{this.selects()}
|
||||
{this.searchForm()}
|
||||
{this.state.type_ == SearchType.All && this.all()}
|
||||
{this.state.type_ == SearchType.Comments && this.comments()}
|
||||
{this.state.type_ == SearchType.Posts && this.posts()}
|
||||
{this.state.type_ == SearchType.Communities && this.communities()}
|
||||
{this.state.type_ == SearchType.Users && this.users()}
|
||||
{this.state.type_ == SearchType.Url && this.posts()}
|
||||
{this.resultsCount() == 0 && <span>{i18n.t("no_results")}</span>}
|
||||
<Paginator page={this.state.page} onChange={this.handlePageChange} />
|
||||
{this.selects}
|
||||
{this.searchForm}
|
||||
{this.displayResults(type)}
|
||||
{this.resultsCount === 0 && !this.state.searchLoading && (
|
||||
<span>{i18n.t("no_results")}</span>
|
||||
)}
|
||||
<Paginator page={page} onChange={this.handlePageChange} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -988,8 +985,8 @@ export class Search extends Component<any, SearchState> {
|
|||
}
|
||||
|
||||
checkFinishedLoading() {
|
||||
if (this.state.searchResponse && this.state.resolveObjectResponse) {
|
||||
this.setState({ loading: false });
|
||||
if (this.state.searchResponse || this.state.resolveObjectResponse) {
|
||||
this.setState({ searchLoading: false });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue