diff --git a/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts b/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts index e6206a3d5f..70950d9227 100644 --- a/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts +++ b/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts @@ -29,7 +29,7 @@ export class FullFileSectionComponent extends FileSectionComponent implements On originals$: Observable>>; licenses$: Observable>>; - pageSize = 2; + pageSize = 5; originalOptions = Object.assign(new PaginationComponentOptions(),{ id: 'original-bitstreams-options', currentPage: 1, diff --git a/src/app/+item-page/simple/field-components/file-section/file-section.component.ts b/src/app/+item-page/simple/field-components/file-section/file-section.component.ts index e4da4f2cca..11c5ff2917 100644 --- a/src/app/+item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/app/+item-page/simple/field-components/file-section/file-section.component.ts @@ -56,18 +56,14 @@ export class FileSectionComponent implements OnInit { } else { this.currentPage++; } - console.log(this.isLastPage); - console.log(this.currentPage); - this.bitstreamDataService.findAllByItemAndBundleName(this.item, 'ORIGINAL', { currentPage: this.currentPage, elementsPerPage: 1 }).pipe( + this.bitstreamDataService.findAllByItemAndBundleName(this.item, 'ORIGINAL', { currentPage: this.currentPage }).pipe( filter((bitstreamsRD: RemoteData>) => hasValue(bitstreamsRD)), takeWhile((bitstreamsRD: RemoteData>) => hasNoValue(bitstreamsRD.payload) && hasNoValue(bitstreamsRD.error), true) ).subscribe((bitstreamsRD: RemoteData>) => { const current: Bitstream[] = this.bitstreams$.getValue(); this.bitstreams$.next([...current, ...bitstreamsRD.payload.page]); this.isLoading = false; - this.isLastPage = hasNoValue(bitstreamsRD.payload.next); - console.log("lel"); - console.log(this.isLastPage); + this.isLastPage = this.currentPage === bitstreamsRD.payload.totalPages; }); } }