diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-19 18:00:31 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-19 18:00:31 +0100 |
commit | 9af61e84309c23ffbfd7562435a5fadd86cdf20c (patch) | |
tree | eb367495b082a776c21b603c40bbe2ad0a8ebc6d /client/src/app/videos/video-list/video-trending.component.ts | |
parent | 606ca5bccf55e75a20a70d41a4d1f2cbf12d2563 (diff) | |
download | PeerTube-9af61e84309c23ffbfd7562435a5fadd86cdf20c.tar.gz PeerTube-9af61e84309c23ffbfd7562435a5fadd86cdf20c.tar.zst PeerTube-9af61e84309c23ffbfd7562435a5fadd86cdf20c.zip |
Don't forget to clean up subscriptions
Diffstat (limited to 'client/src/app/videos/video-list/video-trending.component.ts')
-rw-r--r-- | client/src/app/videos/video-list/video-trending.component.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index a42457273..1dd1ad23b 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 3 | import { immutableAssign } from '@app/shared/misc/utils' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
@@ -12,7 +12,7 @@ import { VideoService } from '../../shared/video/video.service' | |||
12 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], | 12 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], |
13 | templateUrl: '../../shared/video/abstract-video-list.html' | 13 | templateUrl: '../../shared/video/abstract-video-list.html' |
14 | }) | 14 | }) |
15 | export class VideoTrendingComponent extends AbstractVideoList implements OnInit { | 15 | export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy { |
16 | titlePage = 'Trending' | 16 | titlePage = 'Trending' |
17 | currentRoute = '/videos/trending' | 17 | currentRoute = '/videos/trending' |
18 | defaultSort: SortField = '-views' | 18 | defaultSort: SortField = '-views' |
@@ -29,6 +29,10 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit | |||
29 | super.ngOnInit() | 29 | super.ngOnInit() |
30 | } | 30 | } |
31 | 31 | ||
32 | ngOnDestroy () { | ||
33 | super.ngOnDestroy() | ||
34 | } | ||
35 | |||
32 | getVideosObservable (page: number) { | 36 | getVideosObservable (page: number) { |
33 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | 37 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) |
34 | return this.videoService.getVideos(newPagination, this.sort) | 38 | return this.videoService.getVideos(newPagination, this.sort) |