diff --git a/src/frontend/app/ui/gallery/filter/filter.service.ts b/src/frontend/app/ui/gallery/filter/filter.service.ts index 18586588..b207d3ba 100644 --- a/src/frontend/app/ui/gallery/filter/filter.service.ts +++ b/src/frontend/app/ui/gallery/filter/filter.service.ts @@ -2,7 +2,7 @@ import {Injectable} from '@angular/core'; import {BehaviorSubject, Observable} from 'rxjs'; import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; import {DirectoryContent} from '../content.service'; -import {map, mergeMap} from 'rxjs/operators'; +import {map, switchMap} from 'rxjs/operators'; export enum FilterRenderType { enum = 1, range = 2 @@ -90,18 +90,21 @@ export class FilterService { } public applyFilters(directoryContent: Observable): Observable { - return directoryContent.pipe(mergeMap((dirContent: DirectoryContent) => { + return directoryContent.pipe(switchMap((dirContent: DirectoryContent) => { + return this.selectedFilters.pipe(map((filters: SelectedFilter[]) => { if (!dirContent || !dirContent.media || !this.filtersVisible) { return dirContent; } + // clone, so the original won't get overwritten const c = { media: dirContent.media, directories: dirContent.directories, metaFile: dirContent.metaFile }; + for (const f of filters) { // get options diff --git a/src/frontend/app/ui/gallery/navigator/navigator.gallery.component.html b/src/frontend/app/ui/gallery/navigator/navigator.gallery.component.html index 4445d41b..3a9052e4 100644 --- a/src/frontend/app/ui/gallery/navigator/navigator.gallery.component.html +++ b/src/frontend/app/ui/gallery/navigator/navigator.gallery.component.html @@ -1,29 +1,29 @@