optimize remote #2

This commit is contained in:
2022-11-10 16:58:53 +01:00
parent 34cb19dfd0
commit beecbdfb22
7 changed files with 24 additions and 24 deletions

View File

@@ -24,7 +24,7 @@ export class ShowService {
public list$(publishedOnly = false): Observable<Show[]> {
return this.userService.user$.pipe(
switchMap(
() => this.showDataService.list$(),
() => this.showDataService.list$,
(user: User | null, shows: Show[]) => ({user, shows})
),
map(s => s.shows.filter(_ => !_.archived).filter(show => show.published || (show.owner === s.user?.id && !publishedOnly)))