mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: add new matches to MatchList in a correct order
This commit is contained in:
parent
a7561a82b8
commit
7f72112bc5
1 changed files with 2 additions and 2 deletions
|
|
@ -41,10 +41,10 @@ class MatchHelper {
|
||||||
return summonerDB.matchList.some(m => m.gameId === newMatchList[newMatchList.length - 1].gameId)
|
return summonerDB.matchList.some(m => m.gameId === newMatchList[newMatchList.length - 1].gameId)
|
||||||
})
|
})
|
||||||
// Update Summoner's MatchList
|
// Update Summoner's MatchList
|
||||||
for (const match of matchList) {
|
for (const match of matchList.reverse()) {
|
||||||
if (!summonerDB.matchList.some(m => m.gameId === match.gameId)) {
|
if (!summonerDB.matchList.some(m => m.gameId === match.gameId)) {
|
||||||
Logger.transport('file').info(`Match ${match.gameId} has been added to ${account.name}'s MatchList.`)
|
Logger.transport('file').info(`Match ${match.gameId} has been added to ${account.name}'s MatchList.`)
|
||||||
summonerDB.matchList.push(match)
|
summonerDB.matchList.unshift(match)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await summonerDB.save()
|
await summonerDB.save()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue