From 565e2b32fa97e2de3913413813817d24a0415a64 Mon Sep 17 00:00:00 2001 From: Valentin Kaelin Date: Mon, 31 Jan 2022 23:17:37 +0100 Subject: [PATCH] fix: last one... (hope so) --- client/src/store/modules/summoner.js | 4 +++- client/src/views/Summoner.vue | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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) } },