diff --git a/resources/assets/js/views/install/update.js b/resources/assets/js/views/install/update.js
index eeedeec30..c78ab6c74 100644
--- a/resources/assets/js/views/install/update.js
+++ b/resources/assets/js/views/install/update.js
@@ -57,9 +57,10 @@ const app = new Vue({
},
methods: {
- onChangelog() {
- axios.get(url + '/install/updates/changelog')
- .then(response => {
+ async onChangelog() {
+ let changelog_promise = Promise.resolve(axios.get(url + '/install/updates/changelog'));
+
+ changelog_promise.then(response => {
this.changelog.show = true;
this.changelog.html = response.data;
})
@@ -71,14 +72,15 @@ const app = new Vue({
});
},
- steps() {
+ async steps() {
let name = document.getElementById('name').value;
- axios.post(url + '/install/updates/steps', {
+ let steps_promise = Promise.resolve(axios.post(url + '/install/updates/steps', {
name: name,
version: version
- })
- .then(response => {
+ }));
+
+ steps_promise.then(response => {
if (response.data.error) {
this.update.status = 'exception';
this.update.html = '
' + response.data.message + '
';
@@ -96,7 +98,7 @@ const app = new Vue({
});
},
- next() {
+ async next() {
let data = this.update.steps.shift();
let name = document.getElementById('name').value;
@@ -105,18 +107,19 @@ const app = new Vue({
let installed = document.getElementById('installed').value;
if (data) {
- this.update.total = (100 - ((this.update.steps.length / this.update.steps_total) * 100)).toFixed(0);
+ this.update.total = parseInt((100 - ((this.update.steps.length / this.update.steps_total) * 100)).toFixed(0));
this.update.html = ' ' + data['text'] + ' ';
- axios.post(data.url, {
+ let step_promise = Promise.resolve(axios.post(data.url, {
name: name,
alias: alias,
version: version,
installed: installed,
path: this.update.path,
- })
- .then(response => {
+ }));
+
+ step_promise.then(response => {
if (response.data.error) {
this.update.status = 'exception';
this.update.html = ' ' + response.data.message + '
';
@@ -131,11 +134,9 @@ const app = new Vue({
}
if (!response.data.error && !response.data.redirect) {
- let self = this;
-
setTimeout(function() {
- self.next();
- }, 800);
+ this.next();
+ }.bind(this), 800);
}
if (response.data.redirect) {