Skip to content

Commit

Permalink
Solved home pagination error.
Browse files Browse the repository at this point in the history
  • Loading branch information
cvazquezlos committed Apr 26, 2017
1 parent 961b43d commit 1cf727c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/app/component/public/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ export class HomeComponent implements OnInit, DoCheck {
addBooks(userReq: boolean) {
this.resourceService.getAllResources('Libro', this.booksPage).subscribe(
books => {
if (books[1] === undefined) {
console.log('No hay más libros.');
if (Object.keys(books).length === 0) {
this.moreBooksActive = false;
} else if (userReq) {
this.moreBooksActive = true;
Expand All @@ -83,7 +82,7 @@ export class HomeComponent implements OnInit, DoCheck {
addMagazines(userReq: boolean) {
this.resourceService.getAllResources('Revista', this.magazinesPage).subscribe(
magazines => {
if (magazines[1] == null) {
if (Object.keys(magazines).length === 0) {
this.moreMagazActive = false;
} else if (userReq) {
this.moreMagazActive = true;
Expand Down

0 comments on commit 1cf727c

Please sign in to comment.