Skip to content

Commit

Permalink
fix/last match number 0 (#367)
Browse files Browse the repository at this point in the history
* fix: last match number <= 0
  • Loading branch information
JustDams authored Jul 5, 2023
1 parent 12c6901 commit a42d871
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commands/last.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ const getLastCard = async ({
const files = []
const pagination = getPageSlice(page)

maxMatch = maxMatch <= 0 ? playerHistory.length : maxMatch

// Removing multiple ids
const filteredHistory = playerHistory.map(e => e.matchId).filter((e, i, a) => a.indexOf(e) === i).slice(0, maxMatch)
playerHistory = playerHistory.filter(e => filteredHistory.includes(e.matchId))
Expand Down

0 comments on commit a42d871

Please sign in to comment.