diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-11 10:09:18 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-11 10:09:18 +0200 |
commit | 33c4972d5b54155540267f4c9c9ee55c539b8385 (patch) | |
tree | c150d11c0afdeb90c19c4d59297c6829b2d55dd1 /client/src/app/videos/video-list | |
parent | 4771e0008dd26eadbb7eaff64255a6ec914fdadb (diff) | |
download | PeerTube-33c4972d5b54155540267f4c9c9ee55c539b8385.tar.gz PeerTube-33c4972d5b54155540267f4c9c9ee55c539b8385.tar.zst PeerTube-33c4972d5b54155540267f4c9c9ee55c539b8385.zip |
Type webtorrent
Diffstat (limited to 'client/src/app/videos/video-list')
-rw-r--r-- | client/src/app/videos/video-list/video-list.component.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/client/src/app/videos/video-list/video-list.component.ts b/client/src/app/videos/video-list/video-list.component.ts index 0c36e5b08..4ac539960 100644 --- a/client/src/app/videos/video-list/video-list.component.ts +++ b/client/src/app/videos/video-list/video-list.component.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { Subscription } from 'rxjs/Subscription' | ||
3 | import { BehaviorSubject } from 'rxjs/BehaviorSubject' | 4 | import { BehaviorSubject } from 'rxjs/BehaviorSubject' |
4 | 5 | ||
5 | import { NotificationsService } from 'angular2-notifications' | 6 | import { NotificationsService } from 'angular2-notifications' |
@@ -30,8 +31,8 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
30 | videos: Video[] = [] | 31 | videos: Video[] = [] |
31 | 32 | ||
32 | private search: Search | 33 | private search: Search |
33 | private subActivatedRoute: any | 34 | private subActivatedRoute: Subscription |
34 | private subSearch: any | 35 | private subSearch: Subscription |
35 | 36 | ||
36 | constructor ( | 37 | constructor ( |
37 | private notificationsService: NotificationsService, | 38 | private notificationsService: NotificationsService, |
@@ -98,7 +99,7 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
98 | return !this.loading.getValue() && this.videos.length === 0 | 99 | return !this.loading.getValue() && this.videos.length === 0 |
99 | } | 100 | } |
100 | 101 | ||
101 | onPageChanged (event: any) { | 102 | onPageChanged (event: { page: number }) { |
102 | // Be sure the current page is set | 103 | // Be sure the current page is set |
103 | this.pagination.currentPage = event.page | 104 | this.pagination.currentPage = event.page |
104 | 105 | ||
@@ -113,21 +114,21 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
113 | 114 | ||
114 | private buildRouteParams () { | 115 | private buildRouteParams () { |
115 | // There is always a sort and a current page | 116 | // There is always a sort and a current page |
116 | const params: any = { | 117 | const params = { |
117 | sort: this.sort, | 118 | sort: this.sort, |
118 | page: this.pagination.currentPage | 119 | page: this.pagination.currentPage |
119 | } | 120 | } |
120 | 121 | ||
121 | // Maybe there is a search | 122 | // Maybe there is a search |
122 | if (this.search.value) { | 123 | if (this.search.value) { |
123 | params.field = this.search.field | 124 | params['field'] = this.search.field |
124 | params.search = this.search.value | 125 | params['search'] = this.search.value |
125 | } | 126 | } |
126 | 127 | ||
127 | return params | 128 | return params |
128 | } | 129 | } |
129 | 130 | ||
130 | private loadRouteParams (routeParams) { | 131 | private loadRouteParams (routeParams: { [ key: string ]: any }) { |
131 | if (routeParams['search'] !== undefined) { | 132 | if (routeParams['search'] !== undefined) { |
132 | this.search = { | 133 | this.search = { |
133 | value: routeParams['search'], | 134 | value: routeParams['search'], |