Fix usage of webadminStatus

This commit is contained in:
Girish Ramakrishnan
2018-12-14 15:24:00 -08:00
parent 54b9154457
commit a485df2f79
3 changed files with 14 additions and 11 deletions

View File

@@ -195,10 +195,10 @@ app.controller('RestoreController', ['$scope', '$http', 'Client', function ($sco
$scope.busy = true;
Client.getStatus(function (error, status) {
if (!error && !status.webadminStatus.restore.active) { // restore finished
if (status.webadminStatus.restore.error) {
if (!error && !status.restore.active) { // restore finished
if (status.restore.errorMessage) {
$scope.busy = false;
$scope.error.generic = status.webadminStatus.restore.error;
$scope.error.generic = status.restore.errorMessage;
} else { // restore worked, redirect to admin page
window.location.href = '/';
}
@@ -233,9 +233,9 @@ app.controller('RestoreController', ['$scope', '$http', 'Client', function ($sco
return;
}
if (status.webadminStatus.restore.active) return waitForRestore();
if (status.restore.active) return waitForRestore();
if (status.webadminStatus.restore.error) $scope.error.generic = status.webadminStatus.restore.error;
if (status.restore.errorMessage) $scope.error.generic = status.restore.errorMessage;
if (status.activated) {
window.location.href = '/';