mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix(more-matches): apply season filter in more matches results
This commit is contained in:
parent
f869e5b12c
commit
f0a0731ddc
1 changed files with 6 additions and 2 deletions
|
|
@ -175,10 +175,13 @@ export const actions = {
|
||||||
commit('SUMMONER_NOT_PLAYING')
|
commit('SUMMONER_NOT_PLAYING')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async moreMatches({ commit, rootState }) {
|
async moreMatches({ commit, getters, rootState }) {
|
||||||
commit('MATCHES_LOADING')
|
commit('MATCHES_LOADING')
|
||||||
|
|
||||||
const gameIds = state.basic.matchList.slice(state.overview.matchIndex, state.overview.matchIndex + 10).map(({ gameId }) => gameId)
|
const gameIds = state.basic.matchList
|
||||||
|
.filter(match => !getters.regionFilterApplied || match.seasonMatch === state.basic.currentSeason)
|
||||||
|
.slice(state.overview.matchIndex, state.overview.matchIndex + 10)
|
||||||
|
.map(({ gameId }) => gameId)
|
||||||
|
|
||||||
const resp = await axios(({
|
const resp = await axios(({
|
||||||
url: 'match',
|
url: 'match',
|
||||||
|
|
@ -231,6 +234,7 @@ export const getters = {
|
||||||
moreMatchesToFetch: state => state.overview.matchIndex < state.basic.matchList.length,
|
moreMatchesToFetch: state => state.overview.matchIndex < state.basic.matchList.length,
|
||||||
overviewLoaded: state => state.overview.loaded,
|
overviewLoaded: state => state.overview.loaded,
|
||||||
playing: state => state.live.playing,
|
playing: state => state.live.playing,
|
||||||
|
regionFilterApplied: state => !!state.basic.currentSeason,
|
||||||
summonerFound: state => state.basic.status === 'found',
|
summonerFound: state => state.basic.status === 'found',
|
||||||
summonerNotFound: state => state.basic.status === 'error',
|
summonerNotFound: state => state.basic.status === 'error',
|
||||||
summonerLoading: state => state.basic.status === 'loading',
|
summonerLoading: state => state.basic.status === 'loading',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue