From 8e3967c98d70e1a65f95717b33b99dc8738095dd Mon Sep 17 00:00:00 2001 From: Damien <48047820+JustDams@users.noreply.github.com> Date: Thu, 2 Nov 2023 10:10:22 +0100 Subject: [PATCH] fix: last (#400) --- commands/last.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/last.js b/commands/last.js index d2e92a4..37d9543 100644 --- a/commands/last.js +++ b/commands/last.js @@ -104,6 +104,8 @@ const sendCardWithInfo = async ( if (map) mapName = map mapName ??= '' + maxMatch = maxMatch < 1 ? 0 : maxMatch + let { playerDatas, steamDatas, @@ -157,10 +159,8 @@ const getLastCard = async ({ const files = [] const pagination = getPageSlice(page) - maxMatch = maxMatch < 1 ? 0 : maxMatch - // Removing multiple ids - let filteredHistory = playerHistory.map(e => e.matchId).filter((e, i, a) => a.indexOf(e) === i).slice(0, maxMatch ?? playerHistory.length) + let filteredHistory = playerHistory.map(e => e.matchId).filter((e, i, a) => a.indexOf(e) === i).slice(0, playerHistory.length) const maxPage = getMaxPage(filteredHistory) filteredHistory = filteredHistory.slice(pagination.start, pagination.end)