fixed the search

pull/3970/head
Jamie Rees 4 years ago
parent b6d67b2e24
commit 938e8439bc

@ -2,9 +2,14 @@
<div *ngIf="loadingFlag" class="row justify-content-md-center top-spacing loading-spinner"> <div *ngIf="loadingFlag" class="row justify-content-md-center top-spacing loading-spinner">
<mat-spinner [color]="'accent'"></mat-spinner> <mat-spinner [color]="'accent'"></mat-spinner>
</div> </div>
<div *ngIf="discoverResults" class="row full-height"> <div *ngIf="discoverResults && discoverResults.length > 0" class="row full-height discoverResults col">
<div class="col-xl-2 col-lg-3 col-md-3 col-6 col-sm-4 small-padding" *ngFor="let result of discoverResults"> <div class="col-xl-2 col-lg-3 col-md-3 col-6 col-sm-4 small-padding" *ngFor="let result of discoverResults">
<discover-card [result]="result"></discover-card> <discover-card [result]="result"></discover-card>
</div> </div>
</div> </div>
<div *ngIf="!discoverResults || discoverResults.length === 0">
<div class="row justify-content-md-center top-spacing loading-spinner">
<h1>Sorry, nothing matches your search! <i class="fa fa-frown-o" aria-hidden="true"></i></h1>
</div>
</div>
</div> </div>

@ -11,7 +11,7 @@ import { isEqual } from "lodash";
@Component({ @Component({
templateUrl: "./search-results.component.html", templateUrl: "./search-results.component.html",
styleUrls: ["./search-results.component.scss"], styleUrls: ["../discover/discover.component.scss"],
}) })
export class DiscoverSearchResultsComponent implements OnInit { export class DiscoverSearchResultsComponent implements OnInit {
@ -49,6 +49,8 @@ export class DiscoverSearchResultsComponent implements OnInit {
var filter = this.store.get("searchFilter"); var filter = this.store.get("searchFilter");
if (filter) { if (filter) {
this.filter = Object.assign(new SearchFilter(), JSON.parse(filter)); this.filter = Object.assign(new SearchFilter(), JSON.parse(filter));
} else {
this.filter = new SearchFilter({ movies: true, tvShows: true, people: false, music: false});
} }
this.loading(); this.loading();
await this.search(); await this.search();

@ -4,4 +4,7 @@ export class SearchFilter {
tvShows: boolean; tvShows: boolean;
music: boolean; music: boolean;
people: boolean; people: boolean;
public constructor(init?:Partial<SearchFilter>) {
Object.assign(this, init);
}
} }

Loading…
Cancel
Save