network: ipv6 better display of error

This commit is contained in:
Girish Ramakrishnan
2022-02-04 11:16:04 -08:00
parent 9f1ab59e35
commit 1ca07a4c92
2 changed files with 8 additions and 4 deletions

View File

@@ -78,10 +78,14 @@ angular.module('Application').controller('NetworkController', ['$scope', '$locat
$scope.ipv6Configure.error = '';
Client.setIPv6Config($scope.ipv6Configure.enabled, function (error) {
if (error) $scope.ipv6Configure.error = error.message;
else $scope.ipv6Configure.currentState = $scope.ipv6Configure.enabled;
$scope.ipv6Configure.busy = false;
if (error) {
$scope.ipv6Configure.error = error.message;
$scope.ipv6Configure.enabled = !$scope.ipv6Configure.enabled; // restore old state
return;
}
$scope.ipv6Configure.currentState = $scope.ipv6Configure.enabled;
$scope.ipv6Configure.success = true;
});
}