Skip to content

Commit

Permalink
fix(search): 🐛 Fixed an issue where changing the filter wouldn't refr…
Browse files Browse the repository at this point in the history
…esh the search results
  • Loading branch information
tidusjar committed Oct 11, 2021
1 parent 3056788 commit 10f5e05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/Ombi/ClientApp/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { CookieService } from "ng2-cookies";
import { CustomPageComponent } from "./custompage/custompage.component";
import { DataViewModule } from "primeng/dataview";
import { DialogModule } from "primeng/dialog";
import { FilterService } from "./discover/services/filter-service";
import { JwtModule } from "@auth0/angular-jwt";
import { LandingPageComponent } from "./landingpage/landingpage.component";
import { LandingPageService } from "./services";
Expand Down Expand Up @@ -222,7 +221,6 @@ export function JwtTokenGetter() {
MessageService,
StorageService,
RequestService,
FilterService,
SignalRNotificationService,
{
provide: APP_BASE_HREF,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,17 @@ export class DiscoverSearchResultsComponent implements OnInit {

public async ngOnInit() {
this.isAdmin = this.authService.isAdmin();

if (this.advancedDataService) {
return;
}
this.loadingFlag = true;

this.filterService.onFilterChange.subscribe(async x => {
if (!isEqual(this.filter, x)) {
this.filter = { ...x };
await this.search();
}
});

if (this.advancedDataService) {
return;
}
this.loadingFlag = true;
}

public async init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { EventEmitter, Injectable, Output } from "@angular/core";

import { SearchFilter } from "../../my-nav/SearchFilter";

@Injectable()
@Injectable({providedIn: 'root'})
export class FilterService {

@Output() public onFilterChange = new EventEmitter<SearchFilter>();
Expand Down

0 comments on commit 10f5e05

Please sign in to comment.