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 {
data () {
return {
isLoading: true,
batch: null
batch: null,
timeout: null
}
},
created () {
this.fetchData()
},
destroyed () {
if (this.timeout) {
clearTimeout(this.timeout)
}
},
methods: {
fetchData () {
var self = this
......@@ -78,7 +84,7 @@ export default {
self.batch = response.data
self.isLoading = false
if (self.batch.status === 'pending') {
setTimeout(
self.timeout = setTimeout(
self.fetchData,
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