Skip to content
Snippets Groups Projects
Verified Commit f9786d4b authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Remove batch refresh logic when not on batch detail

parent 1800f7ad
No related branches found
No related tags found
No related merge requests found
...@@ -62,12 +62,18 @@ export default { ...@@ -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 { ...@@ -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
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment