mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-31 03:50:08 -07:00
fix(search): 🐛 Fixed an issue where changing the filter wouldn't refresh the search results
This commit is contained in:
parent
3056788d5a
commit
10f5e056c8
3 changed files with 7 additions and 9 deletions
|
@ -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";
|
||||
|
@ -222,7 +221,6 @@ export function JwtTokenGetter() {
|
|||
MessageService,
|
||||
StorageService,
|
||||
RequestService,
|
||||
FilterService,
|
||||
SignalRNotificationService,
|
||||
{
|
||||
provide: APP_BASE_HREF,
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue