diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index 84ca5cbe4..ee1ed2cb2 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts | |||
@@ -32,6 +32,7 @@ export abstract class AbstractVideoList implements OnInit { | |||
32 | // Subscribe to route changes | 32 | // Subscribe to route changes |
33 | const routeParams = this.route.snapshot.params | 33 | const routeParams = this.route.snapshot.params |
34 | this.loadRouteParams(routeParams) | 34 | this.loadRouteParams(routeParams) |
35 | |||
35 | if (this.loadOnInit === true) this.loadMoreVideos('after') | 36 | if (this.loadOnInit === true) this.loadMoreVideos('after') |
36 | } | 37 | } |
37 | 38 | ||
@@ -60,6 +61,13 @@ export abstract class AbstractVideoList implements OnInit { | |||
60 | 61 | ||
61 | observable.subscribe( | 62 | observable.subscribe( |
62 | ({ videos, totalVideos }) => { | 63 | ({ videos, totalVideos }) => { |
64 | // Paging is too high, return to the first one | ||
65 | if (totalVideos <= ((this.pagination.currentPage - 1) * this.pagination.itemsPerPage)) { | ||
66 | this.pagination.currentPage = 1 | ||
67 | this.setNewRouteParams() | ||
68 | return this.reloadVideos() | ||
69 | } | ||
70 | |||
63 | this.loadedPages[this.pagination.currentPage] = true | 71 | this.loadedPages[this.pagination.currentPage] = true |
64 | this.pagination.totalItems = totalVideos | 72 | this.pagination.totalItems = totalVideos |
65 | 73 | ||