From 4fa77d57dfb3c97a3aa8823e4a683d82032c5e7e Mon Sep 17 00:00:00 2001 From: rubyowo Date: Sun, 2 Jun 2024 15:59:41 +0000 Subject: [PATCH] fix: dont show hidden cases without -hidden arg (#477) * fix: dont show hidden cases without -hidden arg * fix: almeida has eagle eyes --- backend/src/plugins/ModActions/commands/CasesUserCmd.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/plugins/ModActions/commands/CasesUserCmd.ts b/backend/src/plugins/ModActions/commands/CasesUserCmd.ts index 7380443d2..c836c0792 100644 --- a/backend/src/plugins/ModActions/commands/CasesUserCmd.ts +++ b/backend/src/plugins/ModActions/commands/CasesUserCmd.ts @@ -102,7 +102,7 @@ export const CasesUserCmd = modActionsCmd({ // Compact view (= regular message with a preview of each case) const casesPlugin = pluginData.getPlugin(CasesPlugin); - const totalPages = Math.max(Math.ceil(cases.length / casesPerPage), 1); + const totalPages = Math.max(Math.ceil(casesToDisplay.length / casesPerPage), 1); const prefix = getGuildPrefix(pluginData); createPaginatedMessage( @@ -110,16 +110,16 @@ export const CasesUserCmd = modActionsCmd({ msg.channel, totalPages, async (page) => { - const chunkedCases = chunkArray(cases, casesPerPage)[page - 1]; + const chunkedCases = chunkArray(casesToDisplay, casesPerPage)[page - 1]; const lines = await asyncMap(chunkedCases, (c) => casesPlugin.getCaseSummary(c, true, msg.author.id)); const isLastPage = page === totalPages; const firstCaseNum = (page - 1) * casesPerPage + 1; - const lastCaseNum = isLastPage ? cases.length : page * casesPerPage; + const lastCaseNum = isLastPage ? casesToDisplay.length : page * casesPerPage; const title = totalPages === 1 ? `Cases for ${userName} (${lines.length} total)` - : `Most recent cases ${firstCaseNum}-${lastCaseNum} of ${cases.length} for ${userName}`; + : `Most recent cases ${firstCaseNum}-${lastCaseNum} of ${casesToDisplay.length} for ${userName}`; const embed = { author: {