diff --git a/client/src/helpers/summoner.js b/client/src/helpers/summoner.js index ebccc55..c285fe9 100644 --- a/client/src/helpers/summoner.js +++ b/client/src/helpers/summoner.js @@ -64,7 +64,8 @@ export function createSummonerData(RiotData) { account: RiotData.account, ranked: RiotData.ranked, matchList: RiotData.allMatches, - matches: createMatchData(RiotData.matchesDetails) + matches: createMatchData(RiotData.matchesDetails), + playing: RiotData.playing } } diff --git a/client/src/store/modules/summoner.js b/client/src/store/modules/summoner.js index 42968fe..3e81f00 100644 --- a/client/src/store/modules/summoner.js +++ b/client/src/store/modules/summoner.js @@ -9,7 +9,8 @@ export const state = { matchIndex: 0, matchList: [], matches: [], - ranked: {} + ranked: {}, + playing: false }, matchesLoading: false, status: '', @@ -35,6 +36,7 @@ export const mutations = { state.infos.matches = infos.matches state.infos.ranked = infos.ranked state.infos.matchIndex = infos.matches.length + state.infos.playing = infos.playing state.status = 'found' }, SUMMONER_NOT_FOUND(state) { @@ -80,6 +82,7 @@ export const actions = { export const getters = { matchesLoading: state => state.matchesLoading, moreMatchesToFetch: state => state.infos.matchIndex < state.infos.matchList.length, + playing: state => state.infos.playing, summonerFound: state => state.status === 'found', summonerNotFound: state => state.status === 'error', summonerLoading: state => state.status === 'loading', diff --git a/client/src/views/Summoner.vue b/client/src/views/Summoner.vue index 3bffd07..004a396 100644 --- a/client/src/views/Summoner.vue +++ b/client/src/views/Summoner.vue @@ -22,14 +22,24 @@