Remove batch refresh logic when not on batch detail
This commit is contained in:
parent
1800f7ad17
commit
f9786d4b45
|
@ -62,12 +62,18 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
batch: null
|
batch: null,
|
||||||
|
timeout: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
|
destroyed () {
|
||||||
|
if (this.timeout) {
|
||||||
|
clearTimeout(this.timeout)
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchData () {
|
fetchData () {
|
||||||
var self = this
|
var self = this
|
||||||
|
@ -78,7 +84,7 @@ export default {
|
||||||
self.batch = response.data
|
self.batch = response.data
|
||||||
self.isLoading = false
|
self.isLoading = false
|
||||||
if (self.batch.status === 'pending') {
|
if (self.batch.status === 'pending') {
|
||||||
setTimeout(
|
self.timeout = setTimeout(
|
||||||
self.fetchData,
|
self.fetchData,
|
||||||
5000
|
5000
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue