style: remove old comments and change method names

This commit is contained in:
Valentin Kaelin 2020-01-01 16:39:54 +01:00
parent 1c9e2b8d70
commit fe60e85b6a
7 changed files with 13 additions and 24 deletions

View file

@ -19,7 +19,7 @@
<div class="px-2 text-white text-center text-sm select-none">
<div>Stats based on</div>
<div>
<span class="text-teal-400 font-bold">{{ stats.global.count }}</span> matches
<span class="text-teal-400 font-bold">{{ stats.global ? stats.global.count : 0 }}</span> matches
</div>
<div class="mt-2 leading-tight text-xs text-blue-100 font-normal italic">
Load more matches

View file

@ -1,5 +1,5 @@
<template>
<div class="mt-4 bg-blue-800 rounded-lg">
<div v-if="stats.global" class="mt-4 bg-blue-800 rounded-lg">
<div class="relative heading flex justify-center py-4 rounded-t-lg text-blue-200">
<svg class="w-6 h-6">
<use xlink:href="#graph" />

View file

@ -124,18 +124,17 @@ export default {
return `${this.summoner}|${this.region}`
},
tabTransition() {
return this.summonerFound ? 'tab' : 'none'
return this.summonerFound && this.overviewLoaded ? 'tab' : 'none'
},
...mapState({
basic: state => state.summoner.basic
}),
...mapGetters('summoner', ['playing', 'summonerFound', 'summonerNotFound', 'summonerLoading'])
...mapGetters('summoner', ['playing', 'overviewLoaded', 'summonerFound', 'summonerNotFound', 'summonerLoading'])
},
watch: {
uri() {
console.log('route changed')
// console.log(this.$router.currentRoute)
this.updateCurrentRegion(this.region)
this.apiCall()
}

View file

@ -87,10 +87,9 @@ export const actions = {
console.log(error)
}
},
async championStats({ commit }, queue = null) {
async championsRequest({ commit }, queue = null) {
const resp = await axios(({ url: 'summoner-champions', data: { puuid: state.basic.account.puuid, queue: queue }, method: 'POST' })).catch(() => { })
console.log('CHAMPIONS STATS')
console.log('queue: ', queue)
console.log('---CHAMPIONS---')
console.log(resp.data)
commit('CHAMPIONS_FOUND', { champions: resp.data })
@ -109,13 +108,7 @@ export const actions = {
},
async overviewRequest({ commit }) {
const resp = await axios(({ url: 'summoner-overview', data: { account: state.basic.account }, method: 'POST' })).catch(() => { })
// setTimeout(() => {
// console.log('OVERVIEW')
// console.log(resp.data)
// resp.data.matches = createMatchData(resp.data.matchesDetails)
// commit('OVERVIEW_FOUND', resp.data)
// }, 2000)
console.log('OVERVIEW')
console.log('---OVERVIEW---')
console.log(resp.data)
resp.data.matches = createMatchData(resp.data.matchesDetails)
commit('OVERVIEW_FOUND', resp.data)

View file

@ -5,7 +5,7 @@
<SummonerStats />
<SummonerMates />
</div>
<div class="w-9/12">
<div v-if="overview.matches.length" class="w-9/12">
<ul>
<Match
v-for="(match, index) in overview.matches"
@ -318,7 +318,6 @@ export default {
methods: {
fetchData() {
if (!this.overviewLoaded && this.summonerFound) {
console.log('FETCHING OVERVIEW')
this.overviewRequest()
}
},

View file

@ -65,19 +65,18 @@ export default {
methods: {
fetchData() {
if (!this.championsLoaded && this.summonerFound) {
console.log('FETCHING CHAMPIONS')
this.championStats()
this.championsRequest()
}
},
filterByQueue(queue) {
queue = Number(queue)
queue = queue === -1 ? null : queue
this.championStats(queue)
this.championsRequest(queue)
},
updateSearch(search) {
this.searchChampions = search
},
...mapActions('summoner', ['championStats']),
...mapActions('summoner', ['championsRequest']),
}
}
</script>

View file

@ -68,7 +68,6 @@ class SummonerController {
async overview({ request, response }) {
console.time('overview')
const account = request.input('account')
console.log(account)
const finalJSON = {}
// Summoner in DB