fix: display reload button if summoner isn't playing

This commit is contained in:
Valentin Kaelin 2020-01-19 17:03:40 +01:00
parent 29605d4de9
commit 8850bcd02c
3 changed files with 13 additions and 2 deletions

View file

@ -25,7 +25,7 @@ export const liveGame = {
return gameModes[this.current.gameQueueConfigId]
},
gameStartTime() {
return this.current.gameStartTime
return this.current ? this.current.gameStartTime : 0
},
teamColor() {
return this.current.participants.find(p => p.summonerId === this.account.id).teamId

View file

@ -86,6 +86,11 @@ export const mutations = {
SUMMONER_NOT_FOUND(state) {
state.basic.status = 'error'
},
SUMMONER_NOT_PLAYING(state) {
state.live.match = {}
state.live.playing = false
state.live.liveLoaded = false
}
}
export const actions = {
@ -133,6 +138,8 @@ export const actions = {
if (resp.data) {
commit('LIVE_FOUND', { live: resp.data })
} else {
commit('SUMMONER_NOT_PLAYING')
}
},
async moreMatches({ commit }) {

View file

@ -19,7 +19,11 @@
<div class="mt-16 flex justify-center">
<div class="bg-gradient px-4 py-3 rounded-lg text-center text-lg text-blue-100 font-bold">
<div>This summoner is not in game.</div>
<div>🕊</div>
<div class="mt-2">🕊</div>
<button
@click="liveMatchRequest"
class="my-4 bg-blue-800 px-3 py-1 text-sm text-blue-100 rounded-md shadow-md hover:bg-blue-760"
>Reload</button>
</div>
</div>
</div>