Merge pull request #1936 from cmgustavo/bug/ui-notification-01

Fix notification/validation when creating and importing a profile
This commit is contained in:
Matias Alejo Garcia 2014-12-03 16:54:04 -03:00
commit 9c18a8a60f
5 changed files with 32 additions and 25 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, notification, pluginManager, identityService) {
angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, $timeout, notification, pluginManager, identityService) {
identityService.goWalletHome();
$scope.createProfile = function(form) {
@ -17,7 +17,16 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
if (msg.indexOf('EEXIST')>=0 || msg.indexOf('BADC')>=0 ) {
msg = 'This profile already exists'
}
$scope.error = msg;
$timeout(function() {
form.email.$setViewValue('');
form.email.$render();
form.password.$setViewValue('');
form.password.$render();
form.repeatpassword.$setViewValue('');
form.repeatpassword.$render();
form.$setPristine();
$scope.error = msg;
},1);
}
});
}

View file

@ -29,7 +29,6 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
} else {
$scope.error = 'Unknown error';
}
$rootScope.$digest();
}
});
};