[KEYCLOAK-5806] - Returning from child policy not restoring state

This commit is contained in:
pedroigor 2017-12-19 10:00:14 -02:00
parent 61fe554617
commit c00d89aec3

View file

@ -2286,6 +2286,7 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
var policy = angular.copy(data);
$scope.changed = $scope.historyBackOnSaveOrCancel || PolicyController.isBackNewAssociatedPolicy();
$scope.policy = angular.copy(policy);
if (PolicyController.isBackNewAssociatedPolicy()) {
if (delegate.onRestoreState) {
@ -2296,8 +2297,6 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
delegate.onInitUpdate(policy);
}
$scope.policy = angular.copy(policy);
$scope.$watch('policy', function() {
if (!angular.equals($scope.policy, policy)) {
$scope.changed = true;