Remove batch refresh logic when not on batch detail

merge-requests/154/head
Eliot Berriot 2018-03-03 12:37:50 +01:00
rodzic 1800f7ad17
commit f9786d4b45
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -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
)