Skip to content

Commit

Permalink
#: Modify PaginationModel
Browse files Browse the repository at this point in the history
  • Loading branch information
zdu-strong committed Jan 20, 2025
1 parent 32c0f22 commit 2eab6f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion capacitor/src/model/PaginationModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class PaginationModel<T> {
}

const totalRecord = (stream as linq.IEnumerable<T>).count();
const totalPage = Math.floor(mathjs.divide(totalRecord, pageSize)) + mathjs.mod(totalRecord, pageSize) > 0 ? 1 : 0;
const totalPage = Math.floor(mathjs.divide(totalRecord, pageSize)) + (mathjs.mod(totalRecord, pageSize) > 0 ? 1 : 0);
const list = (stream as linq.IEnumerable<T>)
.skip(mathjs.multiply(pageNum - 1, pageSize))
.take(pageSize)
Expand Down
2 changes: 1 addition & 1 deletion electron/src/model/PaginationModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class PaginationModel<T> {
}

const totalRecord = (stream as linq.IEnumerable<T>).count();
const totalPage = Math.floor(mathjs.divide(totalRecord, pageSize)) + mathjs.mod(totalRecord, pageSize) > 0 ? 1 : 0;
const totalPage = Math.floor(mathjs.divide(totalRecord, pageSize)) + (mathjs.mod(totalRecord, pageSize) > 0 ? 1 : 0);
const list = (stream as linq.IEnumerable<T>)
.skip(mathjs.multiply(pageNum - 1, pageSize))
.take(pageSize)
Expand Down
2 changes: 1 addition & 1 deletion react/src/model/PaginationModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class PaginationModel<T> {
}

const totalRecord = (stream as linq.IEnumerable<T>).count();
const totalPage = Math.floor(mathjs.divide(totalRecord, pageSize)) + mathjs.mod(totalRecord, pageSize) > 0 ? 1 : 0;
const totalPage = Math.floor(mathjs.divide(totalRecord, pageSize)) + (mathjs.mod(totalRecord, pageSize) > 0 ? 1 : 0);
const list = (stream as linq.IEnumerable<T>)
.skip(mathjs.multiply(pageNum - 1, pageSize))
.take(pageSize)
Expand Down

0 comments on commit 2eab6f9

Please sign in to comment.