fix update timeout listener error

This commit is contained in:
raishvaria
2019-11-25 18:01:40 +05:30
parent a484506029
commit 8058f9b022

View File

@ -76,14 +76,17 @@ export default {
let res = await window.axios.post('/api/update', this.updateData) let res = await window.axios.post('/api/update', this.updateData)
if (res.data.success) { if (res.data.success) {
await window.axios.post('/api/update/finish', this.updateData) setTimeout(async () => {
this.isUpdateAvailable = false await window.axios.post('/api/update/finish', this.updateData)
window.toastr['success'](this.$t('settings.update_app.update_success'))
this.currentVersion = this.updateData.version
setTimeout(() => { window.toastr['success'](this.$t('settings.update_app.update_success'))
location.reload() this.currentVersion = this.updateData.version
}, 2000) this.isUpdateAvailable = false
setTimeout(() => {
location.reload()
}, 2000)
}, 5000)
} else { } else {
console.log(res.data) console.log(res.data)
window.toastr['error'](res.data.error) window.toastr['error'](res.data.error)