diff options
| author | Johann150 <johann.galle@protonmail.com> | 2022-07-05 10:42:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-05 17:42:54 +0900 |
| commit | ef9fdb93d2999e98ea0ecb750ba0f0409793f166 (patch) | |
| tree | 84ad0480f05303fe7720dc801c87aad64babf687 /packages/client/src | |
| parent | fix(client): user search of explore not working (diff) | |
| download | sharkey-ef9fdb93d2999e98ea0ecb750ba0f0409793f166.tar.gz sharkey-ef9fdb93d2999e98ea0ecb750ba0f0409793f166.tar.bz2 sharkey-ef9fdb93d2999e98ea0ecb750ba0f0409793f166.zip | |
fix: pagination uses API correctly (#8925)
Diffstat (limited to 'packages/client/src')
| -rw-r--r-- | packages/client/src/components/ui/pagination.vue | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/client/src/components/ui/pagination.vue b/packages/client/src/components/ui/pagination.vue index c081e06acd..a03c2b3a1d 100644 --- a/packages/client/src/components/ui/pagination.vue +++ b/packages/client/src/components/ui/pagination.vue @@ -133,8 +133,10 @@ const fetchMore = async (): Promise<void> => { limit: SECOND_FETCH_LIMIT + 1, ...(props.pagination.offsetMode ? { 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 => { for (let i = 0; i < res.length; i++) { @@ -169,8 +171,10 @@ const fetchMoreAhead = async (): Promise<void> => { limit: SECOND_FETCH_LIMIT + 1, ...(props.pagination.offsetMode ? { 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 => { if (res.length > SECOND_FETCH_LIMIT) { |