]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix error display in bulk service
authorChocobozzz <me@florianbigard.com>
Wed, 28 Sep 2022 13:15:41 +0000 (15:15 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 28 Sep 2022 13:15:41 +0000 (15:15 +0200)
client/src/app/shared/shared-search/find-in-bulk.service.ts

index d2f8c321369ea31a9a7b0960416ec8c8401b584f..d6ee04379d4e29b5613bc7797235310b09a70f63 100644 (file)
@@ -80,13 +80,18 @@ export class FindInBulkService {
           map(result => result.response.data),
           map(data => data.find(finder))
         )
-        .subscribe(result => {
-          if (!result) {
-            obs.error(new Error($localize`Element ${param} not found`))
-          } else {
+        .subscribe({
+          next: result => {
+            if (!result) {
+              obs.error(new Error($localize`Element ${param} not found`))
+              return
+            }
+
             obs.next(result)
             obs.complete()
-          }
+          },
+
+          error: err => obs.error(err)
         })
 
       observableObject.notifier.next(param)