mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 21:07:27 +00:00
fix: display reload button if summoner isn't playing
This commit is contained in:
parent
29605d4de9
commit
8850bcd02c
3 changed files with 13 additions and 2 deletions
|
|
@ -25,7 +25,7 @@ export const liveGame = {
|
||||||
return gameModes[this.current.gameQueueConfigId]
|
return gameModes[this.current.gameQueueConfigId]
|
||||||
},
|
},
|
||||||
gameStartTime() {
|
gameStartTime() {
|
||||||
return this.current.gameStartTime
|
return this.current ? this.current.gameStartTime : 0
|
||||||
},
|
},
|
||||||
teamColor() {
|
teamColor() {
|
||||||
return this.current.participants.find(p => p.summonerId === this.account.id).teamId
|
return this.current.participants.find(p => p.summonerId === this.account.id).teamId
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,11 @@ export const mutations = {
|
||||||
SUMMONER_NOT_FOUND(state) {
|
SUMMONER_NOT_FOUND(state) {
|
||||||
state.basic.status = 'error'
|
state.basic.status = 'error'
|
||||||
},
|
},
|
||||||
|
SUMMONER_NOT_PLAYING(state) {
|
||||||
|
state.live.match = {}
|
||||||
|
state.live.playing = false
|
||||||
|
state.live.liveLoaded = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
|
|
@ -133,6 +138,8 @@ export const actions = {
|
||||||
|
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
commit('LIVE_FOUND', { live: resp.data })
|
commit('LIVE_FOUND', { live: resp.data })
|
||||||
|
} else {
|
||||||
|
commit('SUMMONER_NOT_PLAYING')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async moreMatches({ commit }) {
|
async moreMatches({ commit }) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,11 @@
|
||||||
<div class="mt-16 flex justify-center">
|
<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 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>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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue