- Filtering now works for all items.

- Todo: Cleanup ugly code.
This commit is contained in:
aditya.chandel
2025-01-23 23:24:54 -07:00
parent d50ad8a8fd
commit a884870190
4 changed files with 92 additions and 65 deletions
@@ -103,8 +103,8 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
if (isAllBooksRoute) {
this.entityType = EntityType.ALL_BOOKS;
this.entityType$ = of(EntityType.ALL_BOOKS);
this.entity$ = of(null);
this.bookState$ = this.fetchAllBooks();
} else {
const routeEntityInfo$ = this.getEntityInfoFromRoute();
@@ -132,6 +132,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
this.bookOrAuthor$.next('');
this.bookTitle = '';
this.deselectAllBooks();
this.clearFilter();
});
}
@@ -244,7 +245,8 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
}
return bookState;
}),
switchMap(bookState => this.headerFilter(bookState))
switchMap(bookState => this.headerFilter(bookState)),
switchMap(bookState => this.sideBarFilter(bookState))
);
}
@@ -404,7 +406,6 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
this.bookFilterComponent.activeAuthor = null;
}
ngAfterViewInit() {
this.bookFilterComponent.authorSelected.subscribe((authorId: number) => {
this.selectedAuthor.next(authorId);