mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: return old matchList from db if Riot API is down
This commit is contained in:
parent
9d2854ad25
commit
1c9e2b8d70
1 changed files with 6 additions and 1 deletions
|
|
@ -15,7 +15,12 @@ class MatchService {
|
|||
let alreadyIn = false
|
||||
let index = 0
|
||||
do {
|
||||
let newMatchList = (await Jax.Matchlist.accountID(account.accountId, account.region, index)).matches
|
||||
let newMatchList = await Jax.Matchlist.accountID(account.accountId, account.region, index)
|
||||
// Error while fetching Riot API
|
||||
if (!newMatchList) {
|
||||
return matchList
|
||||
}
|
||||
newMatchList = newMatchList.matches
|
||||
matchList = [...matchList, ...newMatchList]
|
||||
alreadyIn = newMatchList.length === 0 || stopFetching(newMatchList)
|
||||
// If the match is made in another region : we stop fetching
|
||||
|
|
|
|||
Loading…
Reference in a new issue