From 2ff929ca95b61c7ca8ac9c0701e50a33e54a3185 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 31 May 2024 15:30:04 -0500 Subject: [PATCH] renderAccounts: reverse the list of pubkeys --- src/controllers/api/mutes.ts | 2 +- src/views.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/mutes.ts b/src/controllers/api/mutes.ts index 31f54ee1..90b5f545 100644 --- a/src/controllers/api/mutes.ts +++ b/src/controllers/api/mutes.ts @@ -16,7 +16,7 @@ const mutesController: AppController = async (c) => { if (event10000) { const pubkeys = getTagSet(event10000.tags, 'p'); - return renderAccounts(c, [...pubkeys].reverse()); + return renderAccounts(c, [...pubkeys]); } else { return c.json([]); } diff --git a/src/views.ts b/src/views.ts index b49f13ea..e1172306 100644 --- a/src/views.ts +++ b/src/views.ts @@ -44,7 +44,7 @@ async function renderEventAccounts(c: AppContext, filters: NostrFilter[], opts?: async function renderAccounts(c: AppContext, pubkeys: string[]) { const { offset, limit } = listPaginationSchema.parse(c.req.query()); - const authors = pubkeys.slice(offset, offset + limit); + const authors = pubkeys.reverse().slice(offset, offset + limit); const store = await Storages.db(); const signal = c.req.raw.signal;