Show error message in update dialog if a backup is currently happening

Fixes #89
This commit is contained in:
Johannes
2016-11-07 12:17:55 +01:00
parent 4668e3a771
commit eeb8cc10ae
2 changed files with 10 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
};
$scope.showUpdateModal = function (form) {
$scope.update.error.generic = null;
$scope.update.error.password = null;
$scope.update.password = '';
@@ -76,6 +77,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
};
$scope.doUpdate = function () {
$scope.update.error.generic = null;
$scope.update.error.password = null;
$scope.update.busy = true;
@@ -86,7 +88,13 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
$scope.update.password = '';
$scope.update_form.password.$setPristine();
$('#inputUpdatePassword').focus();
} else if (error.statusCode === 409) {
$scope.update.error.generic = 'Please try again later. The Cloudron is creating a backup at the moment.';
$scope.update.password = '';
$scope.update_form.password.$setPristine();
$('#inputUpdatePassword').focus();
} else {
$scope.update.error.generic = error.message;
console.error('Unable to update.', error);
}
$scope.update.busy = false;