Skip to content

Commit

Permalink
Update pagination.ts types (#425)
Browse files Browse the repository at this point in the history
Update pagination.ts
  • Loading branch information
jeffdaley authored Nov 15, 2023
1 parent 7277c60 commit 1ec7b81
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/app/components/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import RouterService from "@ember/routing/router-service";

interface PaginationComponentSignature {
Args: {
nbPages: number;
currentPage: number;
nbPages?: number;
currentPage?: number;
};
}

Expand All @@ -17,7 +17,12 @@ export default class PaginationComponent extends Component<PaginationComponentSi
}

get pages(): number[] {
if (!this.args.nbPages || !this.args.currentPage) {
return [];
}

let pages = [];

// If there are less than 10 pages of results, show all pages.
// Or if the current page is 6 or less and there are more than 10 pages of
// results, show the first 10 pages.
Expand Down

0 comments on commit 1ec7b81

Please sign in to comment.