Use data.success before grabbing the error

This commit is contained in:
Girish Ramakrishnan
2019-08-30 14:24:59 -07:00
parent 42399469a7
commit e30698459b
3 changed files with 4 additions and 4 deletions

View File

@@ -84,7 +84,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.update.busy = false;
$scope.update.message = '';
$scope.update.percent = 100; // indicates that 'result' is valid
$scope.update.errorMessage = data.errorMessage;
$scope.update.errorMessage = data.success ? '' : data.error.message;
if (!data.errorMessage) $scope.update.reloadIfNeeded(); // assume success