diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-01 13:57:29 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-01 13:57:29 +0100 |
commit | 901637bb87f5eb0518fb7ca69d98b53ed918339e (patch) | |
tree | a8e8943fef7a109ba269d33029174cbdf4dde6d2 /client/src/app/videos | |
parent | a73c582e5b6f5c52427b38aaf55b3afbead24053 (diff) | |
download | PeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.tar.gz PeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.tar.zst PeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.zip |
Add ability to change the homepage
Diffstat (limited to 'client/src/app/videos')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 13 |
1 files changed, 7 insertions, 6 deletions
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 @@ | |||
1 | import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { RedirectService } from '@app/core/routing/redirect.service' | ||
3 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' | 4 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' |
4 | import { MetaService } from '@ngx-meta/core' | 5 | import { MetaService } from '@ngx-meta/core' |
5 | import { NotificationsService } from 'angular2-notifications' | 6 | import { NotificationsService } from 'angular2-notifications' |
6 | import { Observable } from 'rxjs/Observable' | ||
7 | import { Subscription } from 'rxjs/Subscription' | 7 | import { Subscription } from 'rxjs/Subscription' |
8 | import * as videojs from 'video.js' | 8 | import * as videojs from 'video.js' |
9 | import 'videojs-hotkeys' | 9 | import 'videojs-hotkeys' |
@@ -64,7 +64,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
64 | private authService: AuthService, | 64 | private authService: AuthService, |
65 | private notificationsService: NotificationsService, | 65 | private notificationsService: NotificationsService, |
66 | private markdownService: MarkdownService, | 66 | private markdownService: MarkdownService, |
67 | private zone: NgZone | 67 | private zone: NgZone, |
68 | private redirectService: RedirectService | ||
68 | ) {} | 69 | ) {} |
69 | 70 | ||
70 | get user () { | 71 | get user () { |
@@ -142,7 +143,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
142 | .subscribe( | 143 | .subscribe( |
143 | status => { | 144 | status => { |
144 | this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) | 145 | this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) |
145 | this.router.navigate(['/videos/list']) | 146 | this.redirectService.redirectToHomepage() |
146 | }, | 147 | }, |
147 | 148 | ||
148 | error => this.notificationsService.error('Error', error.message) | 149 | error => this.notificationsService.error('Error', error.message) |
@@ -247,7 +248,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
247 | this.notificationsService.success('Success', `Video ${this.video.name} deleted.`) | 248 | this.notificationsService.success('Success', `Video ${this.video.name} deleted.`) |
248 | 249 | ||
249 | // Go back to the video-list. | 250 | // Go back to the video-list. |
250 | this.router.navigate([ '/videos/list' ]) | 251 | this.redirectService.redirectToHomepage() |
251 | }, | 252 | }, |
252 | 253 | ||
253 | error => this.notificationsService.error('Error', error.message) | 254 | error => this.notificationsService.error('Error', error.message) |
@@ -313,7 +314,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
313 | 'This video contains mature or explicit content. Are you sure you want to watch it?', | 314 | 'This video contains mature or explicit content. Are you sure you want to watch it?', |
314 | 'Mature or explicit content' | 315 | 'Mature or explicit content' |
315 | ) | 316 | ) |
316 | if (res === false) return this.router.navigate([ '/videos/list' ]) | 317 | if (res === false) return this.redirectService.redirectToHomepage() |
317 | } | 318 | } |
318 | 319 | ||
319 | if (!this.hasAlreadyAcceptedPrivacyConcern()) { | 320 | if (!this.hasAlreadyAcceptedPrivacyConcern()) { |
@@ -323,7 +324,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
323 | 'Privacy concern', | 324 | 'Privacy concern', |
324 | 'I accept!' | 325 | 'I accept!' |
325 | ) | 326 | ) |
326 | if (res === false) return this.router.navigate([ '/videos/list' ]) | 327 | if (res === false) return this.redirectService.redirectToHomepage() |
327 | } | 328 | } |
328 | 329 | ||
329 | this.acceptedPrivacyConcern() | 330 | this.acceptedPrivacyConcern() |