fix(SortedTable): infinite loop when displaying last page (#2568)

Fixes #2569
This commit is contained in:
Julien Fontanet 2018-01-15 16:56:00 +01:00 committed by GitHub
parent d7f8d12d88
commit dd6987efe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -518,8 +518,9 @@ export default class SortedTable extends Component {
return this._setPage(1)
}
if (page * itemsPerPage > n) {
return this._setPage(ceil(n / itemsPerPage))
const last = ceil(n / itemsPerPage)
if (page > last) {
return this._setPage(last)
}
}