mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 21:07:27 +00:00
style: remove old comments and change method names
This commit is contained in:
parent
1c9e2b8d70
commit
fe60e85b6a
7 changed files with 13 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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" />
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export const actions = {
|
|||
try {
|
||||
const resp = await axios(({ url: 'summoner-basic', data: { summoner, region }, method: 'POST' }))
|
||||
if (resp.data) {
|
||||
console.log('--- SUMMONER INFOS ---')
|
||||
console.log('---SUMMONER INFOS---')
|
||||
console.log(resp.data)
|
||||
const infos = createBasicSummonerData(resp.data)
|
||||
commit('SUMMONER_FOUND', infos)
|
||||
|
|
@ -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 })
|
||||
|
|
@ -102,20 +101,14 @@ export const actions = {
|
|||
const gameIds = state.basic.matchList.slice(state.overview.matchIndex, state.overview.matchIndex + 10).map(({ gameId }) => gameId)
|
||||
|
||||
const resp = await axios(({ url: 'match', data: { account, gameIds }, method: 'POST' })).catch(() => { })
|
||||
console.log('--- MATCHES INFOS ---')
|
||||
console.log('---MATCHES INFOS---')
|
||||
console.log(resp.data)
|
||||
const newMatches = createMatchData(resp.data.matches)
|
||||
commit('MATCHES_FOUND', { newMatches, stats: resp.data.stats })
|
||||
},
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue