mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
fix: pagination uses API correctly (#8925)
This commit is contained in:
parent
516cb31ca7
commit
91c3c92573
1 changed files with 6 additions and 2 deletions
|
@ -133,8 +133,10 @@ const fetchMore = async (): Promise<void> => {
|
||||||
limit: SECOND_FETCH_LIMIT + 1,
|
limit: SECOND_FETCH_LIMIT + 1,
|
||||||
...(props.pagination.offsetMode ? {
|
...(props.pagination.offsetMode ? {
|
||||||
offset: offset.value,
|
offset: offset.value,
|
||||||
|
} : props.pagination.reversed ? {
|
||||||
|
sinceId: items.value[0].id,
|
||||||
} : {
|
} : {
|
||||||
untilId: props.pagination.reversed ? items.value[0].id : items.value[items.value.length - 1].id,
|
untilId: items.value[items.value.length - 1].id,
|
||||||
}),
|
}),
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
for (let i = 0; i < res.length; i++) {
|
for (let i = 0; i < res.length; i++) {
|
||||||
|
@ -169,8 +171,10 @@ const fetchMoreAhead = async (): Promise<void> => {
|
||||||
limit: SECOND_FETCH_LIMIT + 1,
|
limit: SECOND_FETCH_LIMIT + 1,
|
||||||
...(props.pagination.offsetMode ? {
|
...(props.pagination.offsetMode ? {
|
||||||
offset: offset.value,
|
offset: offset.value,
|
||||||
|
} : props.pagination.reversed ? {
|
||||||
|
untilId: items.value[0].id,
|
||||||
} : {
|
} : {
|
||||||
sinceId: props.pagination.reversed ? items.value[0].id : items.value[items.value.length - 1].id,
|
sinceId: items.value[items.value.length - 1].id,
|
||||||
}),
|
}),
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.length > SECOND_FETCH_LIMIT) {
|
if (res.length > SECOND_FETCH_LIMIT) {
|
||||||
|
|
Loading…
Reference in a new issue