Skip to content

Commit

Permalink
fix: 🐛 Hides no results message during search. (#4375)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernarden authored Oct 27, 2021
1 parent 881561e commit b819b0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class DiscoverSearchResultsComponent implements OnInit {
this.clear();
this.loadAdvancedData();
});

}

public async ngOnInit() {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -119,6 +117,7 @@ export class DiscoverSearchResultsComponent implements OnInit {
tvMovieDb: mediaType === RequestType.tvShow ? true : false
});
});
this.finishLoading();
}

private loading() {
Expand Down Expand Up @@ -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();
}
}

0 comments on commit b819b0e

Please sign in to comment.