Fix video not found in watch component
authorChocobozzz <florian.bigard@gmail.com>
Thu, 19 Oct 2017 13:47:56 +0000 (15:47 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Thu, 19 Oct 2017 13:47:56 +0000 (15:47 +0200)
client/src/app/videos/+video-watch/video-watch.component.ts

index 8b5abc3f37f4f1566c96baa9059bc7a03a741425..f45ffd82f3cf633ae3b6c7c72d1b77ec7dab1f6e 100644 (file)
@@ -37,6 +37,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
   userRating: UserVideoRateType = null
   video: Video = null
   videoPlayerLoaded = false
+  videoNotFound = false
 
   private paramsSub: Subscription
 
@@ -58,7 +59,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
       this.videoService.getVideo(uuid).subscribe(
         video => this.onVideoFetched(video),
 
-        error => console.error(error)
+        error => {
+          this.videoNotFound = true
+          console.error(error)
+        }
       )
     })
   }