aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts
index ee1ed2cb2..ba1635a18 100644
--- a/client/src/app/shared/video/abstract-video-list.ts
+++ b/client/src/app/shared/video/abstract-video-list.ts
@@ -62,7 +62,7 @@ export abstract class AbstractVideoList implements OnInit {
62 observable.subscribe( 62 observable.subscribe(
63 ({ videos, totalVideos }) => { 63 ({ videos, totalVideos }) => {
64 // Paging is too high, return to the first one 64 // Paging is too high, return to the first one
65 if (totalVideos <= ((this.pagination.currentPage - 1) * this.pagination.itemsPerPage)) { 65 if (this.pagination.currentPage > 1 && totalVideos <= ((this.pagination.currentPage - 1) * this.pagination.itemsPerPage)) {
66 this.pagination.currentPage = 1 66 this.pagination.currentPage = 1
67 this.setNewRouteParams() 67 this.setNewRouteParams()
68 return this.reloadVideos() 68 return this.reloadVideos()
@@ -82,6 +82,10 @@ export abstract class AbstractVideoList implements OnInit {
82 } 82 }
83 83
84 protected hasMoreVideos () { 84 protected hasMoreVideos () {
85 // No results
86 if (this.pagination.totalItems === 0) return false
87
88 // Not loaded yet
85 if (!this.pagination.totalItems) return true 89 if (!this.pagination.totalItems) return true
86 90
87 const maxPage = this.pagination.totalItems / this.pagination.itemsPerPage 91 const maxPage = this.pagination.totalItems / this.pagination.itemsPerPage