diff --git a/client/src/store/modules/summoner.js b/client/src/store/modules/summoner.js index defe23e..05107e1 100644 --- a/client/src/store/modules/summoner.js +++ b/client/src/store/modules/summoner.js @@ -57,7 +57,9 @@ export const mutations = { }, KEEP_LAST_X_MATCHES(state, number) { state.overview.matches = state.overview.matches.slice(0, number) - state.overview.lastMatchId = state.overview.matches[state.overview.matches.length - 1].matchId + if (state.overview.matches.length > 0) { + state.overview.lastMatchId = state.overview.matches[state.overview.matches.length - 1].matchId + } }, LIVE_FOUND(state, { live }) { state.live.match = live diff --git a/client/src/views/Summoner.vue b/client/src/views/Summoner.vue index a8c1093..959ce1b 100644 --- a/client/src/views/Summoner.vue +++ b/client/src/views/Summoner.vue @@ -102,7 +102,7 @@ export default { this.overviewRequest() } // Keep only the 10 last matches when summoner enters overview page - else if (this.overviewLoaded && this.summonerFound && this.overview.matches.length !== 10) { + else if (this.overviewLoaded && this.summonerFound && this.overview.matches.length > 10) { this.sliceOverviewMatches(10) } },