diff options
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/videos/video-list/video-list.component.ts | 10 |
1 files changed, 8 insertions, 2 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 062340ec5..7c6d4b992 100644 --- a/client/src/app/videos/video-list/video-list.component.ts +++ b/client/src/app/videos/video-list/video-list.component.ts | |||
@@ -66,6 +66,8 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
66 | // Subscribe to search changes | 66 | // Subscribe to search changes |
67 | this.subSearch = this.searchService.searchUpdated.subscribe(search => { | 67 | this.subSearch = this.searchService.searchUpdated.subscribe(search => { |
68 | this.search = search; | 68 | this.search = search; |
69 | // Reset pagination | ||
70 | this.pagination.currentPage = 1; | ||
69 | 71 | ||
70 | this.navigateToNewParams(); | 72 | this.navigateToNewParams(); |
71 | }); | 73 | }); |
@@ -76,7 +78,7 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
76 | this.subSearch.unsubscribe(); | 78 | this.subSearch.unsubscribe(); |
77 | } | 79 | } |
78 | 80 | ||
79 | getVideos(detectChanges = true) { | 81 | getVideos() { |
80 | this.loading.next(true); | 82 | this.loading.next(true); |
81 | this.videos = []; | 83 | this.videos = []; |
82 | 84 | ||
@@ -153,7 +155,11 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
153 | 155 | ||
154 | this.sort = <SortField>routeParams['sort'] || '-createdDate'; | 156 | this.sort = <SortField>routeParams['sort'] || '-createdDate'; |
155 | 157 | ||
156 | this.pagination.currentPage = parseInt(routeParams['page']) || 1; | 158 | if (routeParams['page'] !== undefined) { |
159 | this.pagination.currentPage = parseInt(routeParams['page']); | ||
160 | } else { | ||
161 | this.pagination.currentPage = 1; | ||
162 | } | ||
157 | 163 | ||
158 | this.changeDetector.detectChanges(); | 164 | this.changeDetector.detectChanges(); |
159 | } | 165 | } |