fix: 🐛 Hides no results message during search. (#4375)

pull/4366/head
Victor Usoltsev 3 years ago committed by GitHub
parent 881561eaac
commit b819b0e007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,14 +1,13 @@
<div class="small-middle-container" >
<div *ngIf="loadingFlag" class="row justify-content-md-center top-spacing loading-spinner">
<mat-spinner [color]="'accent'"></mat-spinner>
</div>
<div *ngIf="discoverResults && discoverResults.length > 0" class="row full-height discoverResults col" >
<div *ngIf="discoverResults.length > 0" class="row full-height discoverResults col" >
<div id="searchResults" class="col-xl-2 col-lg-3 col-md-3 col-6 col-sm-4 small-padding" *ngFor="let result of discoverResults" data-test="searchResultsCount" attr.search-count="{{discoverResults.length}}">
<discover-card [isAdmin]="isAdmin" [result]="result"></discover-card>
</div>
</div>
<div *ngIf="!discoverResults || discoverResults.length === 0">
<div *ngIf="!loadingFlag && discoverResults.length === 0">
<div class="row justify-content-md-center top-spacing loading-spinner">
<h1 id="noSearchResult"> {{'Discovery.NoSearch' | translate}} <i class="far fa-frown" aria-hidden="true"></i></h1>
</div>

@ -50,7 +50,6 @@ export class DiscoverSearchResultsComponent implements OnInit {
this.clear();
this.loadAdvancedData();
});
}
public async ngOnInit() {
@ -79,8 +78,7 @@ export class DiscoverSearchResultsComponent implements OnInit {
await this.search();
}
public createInitalModel() {
this.finishLoading();
private createInitialModel() {
this.results.forEach(m => {
let mediaType = RequestType.movie;
@ -119,6 +117,7 @@ export class DiscoverSearchResultsComponent implements OnInit {
tvMovieDb: mediaType === RequestType.tvShow ? true : false
});
});
this.finishLoading();
}
private loading() {
@ -180,6 +179,6 @@ export class DiscoverSearchResultsComponent implements OnInit {
this.clear();
this.results = await this.searchService
.multiSearch(this.searchTerm, this.filter).toPromise();
this.createInitalModel();
this.createInitialModel();
}
}

Loading…
Cancel
Save