track current config separately

This commit is contained in:
Girish Ramakrishnan
2019-11-07 23:04:02 -08:00
parent 97782d29cc
commit b6b5875786
2 changed files with 15 additions and 9 deletions

View File

@@ -312,10 +312,10 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
Client.getRegistryConfig(function (error, result) {
if (error) return console.error(error);
$scope.registryConfig.serverAddress = result.serverAddress;
$scope.registryConfig.username = result.username || '';
$scope.registryConfig.email = result.email || '';
$scope.registryConfig.password = result.password;
$scope.registryConfig.currentConfig.serverAddress = result.serverAddress;
$scope.registryConfig.currentConfig.username = result.username || '';
$scope.registryConfig.currentConfig.email = result.email || '';
$scope.registryConfig.currentConfig.password = result.password;
});
}
@@ -371,11 +371,17 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
username: '',
password: '',
email: '',
currentConfig: {},
reset: function () {
$scope.cloudronNameChange.busy = false;
$scope.registryConfig.error = null;
$scope.registryConfig.serverAddress = $scope.registryConfig.currentConfig.serverAddress;
$scope.registryConfig.username = $scope.registryConfig.currentConfig.username;
$scope.registryConfig.email = $scope.registryConfig.currentConfig.email;
$scope.registryConfig.password = $scope.registryConfig.currentConfig.password;
$scope.registryConfigForm.$setUntouched();
$scope.registryConfigForm.$setPristine();
},