From eee9a5f85310ea7042e42e6bc40ecff3b682d9fd Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:26:20 +0900 Subject: enhance(frontend): ページネーションの並び順を逆にできるように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/composables/use-pagination.ts | 37 +++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'packages/frontend/src/composables/use-pagination.ts') diff --git a/packages/frontend/src/composables/use-pagination.ts b/packages/frontend/src/composables/use-pagination.ts index 6a9f00bb91..ed891c0b14 100644 --- a/packages/frontend/src/composables/use-pagination.ts +++ b/packages/frontend/src/composables/use-pagination.ts @@ -33,8 +33,14 @@ export type PagingCtx { // 逆順で返ってくるので - if (props.ctx.baseId && props.ctx.direction === 'newer') { + if (props.ctx.initialId && props.ctx.initialDirection === 'newer') { res.reverse(); } @@ -167,6 +174,7 @@ export function usePagination { + fetchingNewer.value = true; const params = props.ctx.params ? isRef(props.ctx.params) ? props.ctx.params.value : props.ctx.params : {}; await misskeyApi(props.ctx.endpoint, { ...params, @@ -186,8 +194,14 @@ export function usePagination { + fetchingNewer.value = false; }); } @@ -253,6 +267,11 @@ export function usePagination) { + props.ctx = ctx; + reload(); + } + if (props.autoInit !== false) { onMounted(() => { init(); @@ -264,6 +283,7 @@ export function usePagination