correct page index for negative page arguments
This commit is contained in:
parent
4122f6e5ae
commit
9574634b30
1 changed files with 1 additions and 1 deletions
|
|
@ -37,7 +37,7 @@ const getWallPage = async page => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const actualPageIdx = page < 0 ? totalPages + (page + 1) : page - 1
|
const actualPageIdx = page < 0 ? totalPages + page : page - 1
|
||||||
|
|
||||||
if (actualPageIdx > totalPages - 1) {
|
if (actualPageIdx > totalPages - 1) {
|
||||||
throw new RangeError(`Requested a page out of bounds`)
|
throw new RangeError(`Requested a page out of bounds`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue