get only statistics when user is login and index page is open
This commit is contained in:
parent
347b6654ef
commit
11555979e2
@ -234,8 +234,12 @@ export default {
|
||||
|
||||
if (process.browser && !this.interval) {
|
||||
this.interval = setInterval(async () => {
|
||||
const response = await this.$axios.get('api/player/stats/?stats=all')
|
||||
this.stat = response.data
|
||||
if (this.$store.state.auth.isLogin && this.$route.path === '/') {
|
||||
const response = await this.$axios.get('api/player/stats/?stats=all')
|
||||
this.stat = response.data
|
||||
} else {
|
||||
clearInterval(this.interval)
|
||||
}
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user