diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-06 09:19:25 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-06 09:19:25 +0100 |
commit | a2b817d322ef4074bdaaf2589ada567f338323f4 (patch) | |
tree | 3738ebd74821872f14a3392ca8943a968a4cf547 /client/src/app/shared/video | |
parent | a06a31c75c0cd4d337e3e193c670a77cabcd9507 (diff) | |
download | PeerTube-a2b817d322ef4074bdaaf2589ada567f338323f4.tar.gz PeerTube-a2b817d322ef4074bdaaf2589ada567f338323f4.tar.zst PeerTube-a2b817d322ef4074bdaaf2589ada567f338323f4.zip |
Better error messages
Diffstat (limited to 'client/src/app/shared/video')
-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 | ||