Skip to content

Commit

Permalink
fix: last (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDams authored Nov 2, 2023
1 parent 3ff58c3 commit 8e3967c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands/last.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ const sendCardWithInfo = async (
if (map) mapName = map
mapName ??= ''

maxMatch = maxMatch < 1 ? 0 : maxMatch

let {
playerDatas,
steamDatas,
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 8e3967c

Please sign in to comment.