]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+video-channels/video-channels.component.ts
Fix i18n in components
[github/Chocobozzz/PeerTube.git] / client / src / app / +video-channels / video-channels.component.ts
index 5eca64fb55697e9c1c71c2250edbb807869d20d1..09541b370e52febb413ae2853058a40dbb6f22e0 100644 (file)
@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core'
 import { ActivatedRoute } from '@angular/router'
 import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
 import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
+import { RestExtractor } from '@app/shared'
+import { catchError } from 'rxjs/operators'
 
 @Component({
   templateUrl: './video-channels.component.html',
@@ -12,13 +14,15 @@ export class VideoChannelsComponent implements OnInit {
 
   constructor (
     private route: ActivatedRoute,
-    private videoChannelService: VideoChannelService
+    private videoChannelService: VideoChannelService,
+    private restExtractor: RestExtractor
   ) {}
 
   ngOnInit () {
     const videoChannelId = this.route.snapshot.params['videoChannelId']
 
     this.videoChannelService.getVideoChannel(videoChannelId)
+        .pipe(catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ])))
         .subscribe(videoChannel => this.videoChannel = videoChannel)
   }
 }