]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/video-watch/video-watch.component.ts
Add tags support to the video list
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-watch / video-watch.component.ts
index 05e844f60e5be0569ade01a93de61400c85e2a5a..99188bfb376a15a553e6566ac0326732fc6e34d2 100644 (file)
@@ -1,5 +1,5 @@
 import { Component, ElementRef, OnInit } from '@angular/core';
-import { CanDeactivate, ComponentInstruction, RouteParams } from '@angular/router-deprecated';
+import { CanDeactivate, RouteSegment } from '@angular/router';
 
 import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
 
@@ -30,7 +30,7 @@ export class VideoWatchComponent implements OnInit, CanDeactivate {
 
   constructor(
     private elementRef: ElementRef,
-    private routeParams: RouteParams,
+    private routeSegment: RouteSegment,
     private videoService: VideoService,
     private webTorrentService: WebTorrentService
   ) {}
@@ -74,7 +74,7 @@ export class VideoWatchComponent implements OnInit, CanDeactivate {
   }
 
   ngOnInit() {
-    let id = this.routeParams.get('id');
+    let id = this.routeSegment.getParam('id');
     this.videoService.getVideo(id).subscribe(
       video => {
         this.video = video;
@@ -84,11 +84,11 @@ export class VideoWatchComponent implements OnInit, CanDeactivate {
     );
   }
 
-  routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction) {
+  routerCanDeactivate() {
     console.log('Removing video from webtorrent.');
     clearInterval(this.torrentInfosInterval);
     this.webTorrentService.remove(this.video.magnetUri);
-    return true;
+    return Promise.resolve(true);
   }
 
   private loadTooLong() {