]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video-caption/video-caption.service.ts
Improve frontend accessibility
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video-caption / video-caption.service.ts
index d1444902d1dd6e5dfe1a3c0d4149fbb62f38212b..e835981dd2d912c3d66f5a52c5dfc8ce0586fdaf 100644 (file)
@@ -42,8 +42,6 @@ export class VideoCaptionService {
   }
 
   updateCaptions (videoId: number | string, videoCaptions: VideoCaptionEdit[]) {
-    if (videoCaptions.length === 0) return of(true)
-
     const observables: Observable<any>[] = []
 
     for (const videoCaption of videoCaptions) {
@@ -58,6 +56,8 @@ export class VideoCaptionService {
       }
     }
 
+    if (observables.length === 0) return of(true)
+
     return forkJoin(observables)
   }
 }