]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/rest/component-pagination.model.ts
Merge branch 'develop' into pr/1217
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / rest / component-pagination.model.ts
CommitLineData
4635f59d 1export interface ComponentPagination {
d592e0a9
C
2 currentPage: number
3 itemsPerPage: number
b1fa3eba 4 totalItems?: number
d592e0a9 5}
2f1548fd
C
6
7export function hasMoreItems (componentPagination: ComponentPagination) {
8 // No results
9 if (componentPagination.totalItems === 0) return false
10
11 // Not loaded yet
12 if (!componentPagination.totalItems) return true
13
14 const maxPage = componentPagination.totalItems / componentPagination.itemsPerPage
15 return maxPage > componentPagination.currentPage
16}