X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-watch%2Fvideo-watch.component.ts;h=66ef0399ac063d1f74ace2d09e161c999b994615;hb=901637bb87f5eb0518fb7ca69d98b53ed918339e;hp=585ab2e00502f172a8c8fc92dab1171a0a67980e;hpb=57886d66718f0c2dd21f735472e35900a5059cce;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 585ab2e00..66ef0399a 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -1,9 +1,9 @@ import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' +import { RedirectService } from '@app/core/routing/redirect.service' import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' import { MetaService } from '@ngx-meta/core' import { NotificationsService } from 'angular2-notifications' -import { Observable } from 'rxjs/Observable' import { Subscription } from 'rxjs/Subscription' import * as videojs from 'video.js' import 'videojs-hotkeys' @@ -64,7 +64,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { private authService: AuthService, private notificationsService: NotificationsService, private markdownService: MarkdownService, - private zone: NgZone + private zone: NgZone, + private redirectService: RedirectService ) {} get user () { @@ -142,7 +143,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { .subscribe( status => { this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) - this.router.navigate(['/videos/list']) + this.redirectService.redirectToHomepage() }, error => this.notificationsService.error('Error', error.message) @@ -247,7 +248,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.notificationsService.success('Success', `Video ${this.video.name} deleted.`) // Go back to the video-list. - this.router.navigate([ '/videos/list' ]) + this.redirectService.redirectToHomepage() }, error => this.notificationsService.error('Error', error.message) @@ -313,7 +314,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { 'This video contains mature or explicit content. Are you sure you want to watch it?', 'Mature or explicit content' ) - if (res === false) return this.router.navigate([ '/videos/list' ]) + if (res === false) return this.redirectService.redirectToHomepage() } if (!this.hasAlreadyAcceptedPrivacyConcern()) { @@ -323,7 +324,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { 'Privacy concern', 'I accept!' ) - if (res === false) return this.router.navigate([ '/videos/list' ]) + if (res === false) return this.redirectService.redirectToHomepage() } this.acceptedPrivacyConcern()