mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-02 01:01: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}
|
path={this.context.router.route.match.url}
|
||||||
/>
|
/>
|
||||||
<h5>{i18n.t("search")}</h5>
|
<h5>{i18n.t("search")}</h5>
|
||||||
{this.selects()}
|
{this.selects}
|
||||||
{this.searchForm()}
|
{this.searchForm}
|
||||||
{this.state.type_ == SearchType.All && this.all()}
|
{this.displayResults(type)}
|
||||||
{this.state.type_ == SearchType.Comments && this.comments()}
|
{this.resultsCount === 0 && !this.state.searchLoading && (
|
||||||
{this.state.type_ == SearchType.Posts && this.posts()}
|
<span>{i18n.t("no_results")}</span>
|
||||||
{this.state.type_ == SearchType.Communities && this.communities()}
|
)}
|
||||||
{this.state.type_ == SearchType.Users && this.users()}
|
<Paginator page={page} onChange={this.handlePageChange} />
|
||||||
{this.state.type_ == SearchType.Url && this.posts()}
|
|
||||||
{this.resultsCount() == 0 && <span>{i18n.t("no_results")}</span>}
|
|
||||||
<Paginator page={this.state.page} onChange={this.handlePageChange} />
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -988,8 +985,8 @@ 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({ loading: false });
|
this.setState({ searchLoading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue