aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-search
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-02 16:50:56 +0200
committerChocobozzz <me@florianbigard.com>2021-08-02 17:10:07 +0200
commitff4de38385049bf8f6e1d76d8511854fcfabc71c (patch)
tree217dba89333609fc0255c2efbc38c0e7a8379bb8 /client/src/app/shared/shared-search
parent3da38d6e9f8d600476be276666ac7223aa5f172c (diff)
downloadPeerTube-ff4de38385049bf8f6e1d76d8511854fcfabc71c.tar.gz
PeerTube-ff4de38385049bf8f6e1d76d8511854fcfabc71c.tar.zst
PeerTube-ff4de38385049bf8f6e1d76d8511854fcfabc71c.zip
Filter videos by live in custom markup
Diffstat (limited to 'client/src/app/shared/shared-search')
-rw-r--r--client/src/app/shared/shared-search/find-in-bulk.service.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-search/find-in-bulk.service.ts b/client/src/app/shared/shared-search/find-in-bulk.service.ts
index 0383d8648..61dd2cbc5 100644
--- a/client/src/app/shared/shared-search/find-in-bulk.service.ts
+++ b/client/src/app/shared/shared-search/find-in-bulk.service.ts
@@ -1,6 +1,6 @@
1import * as debug from 'debug' 1import * as debug from 'debug'
2import { Observable, Subject } from 'rxjs' 2import { Observable, Subject, throwError } from 'rxjs'
3import { map } from 'rxjs/operators' 3import { first, map } from 'rxjs/operators'
4import { Injectable, NgZone } from '@angular/core' 4import { Injectable, NgZone } from '@angular/core'
5import { buildBulkObservable } from '@app/helpers' 5import { buildBulkObservable } from '@app/helpers'
6import { ResultList } from '@shared/models/common' 6import { ResultList } from '@shared/models/common'
@@ -71,12 +71,17 @@ export class FindInBulkService {
71 return new Observable<R>(obs => { 71 return new Observable<R>(obs => {
72 observableObject.result 72 observableObject.result
73 .pipe( 73 .pipe(
74 first(),
74 map(({ data }) => data), 75 map(({ data }) => data),
75 map(data => data.find(finder)) 76 map(data => data.find(finder))
76 ) 77 )
77 .subscribe(result => { 78 .subscribe(result => {
78 obs.next(result) 79 if (!result) {
79 obs.complete() 80 obs.error(new Error($localize`Element ${param} not found`))
81 } else {
82 obs.next(result)
83 obs.complete()
84 }
80 }) 85 })
81 86
82 observableObject.notifier.next(param) 87 observableObject.notifier.next(param)