fix login / create form errors and confirmed messages

This commit is contained in:
Matias Alejo Garcia 2014-11-01 21:34:03 -03:00
commit 3360c31a12
10 changed files with 74 additions and 23 deletions

View file

@ -2,11 +2,10 @@
angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager, identityService) {
controllerUtils.redirIfLogged();
$scope.retreiving = false;
$scope.loading = false;
$scope.createProfile = function(form) {
if (form && form.$invalid) {
notification.error('Error', 'Please enter the required fields');
$scope.error('Error', 'Please enter the required fields');
return;
}
$scope.loading = true;

View file

@ -0,0 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('EmailConfirmationController', function($scope, $rootScope, $location) {
$rootScope.fromEmailConfirmation = true;
$location.path('/');
});

View file

@ -2,13 +2,27 @@
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager, identityService, Compatibility) {
controllerUtils.redirIfLogged();
$scope.confirmedEmail = getParam('confirmed');
// This is only for backwards compat, insight api should link to #!/confirmed directly
if (getParam('confirmed')) {
var hashIndex = window.location.href.indexOf('/?');
window.location = window.location.href.substr(0, hashIndex) + '#!/confirmed';
return;
}
if ($rootScope.fromEmailConfirmation) {
$scope.confirmedEmail = true;
$rootScope.fromEmailConfirmation = false;
}
$scope.retreiving = false;
Compatibility.check($scope);
$scope.openProfile = function(form) {
$scope.confirmedEmail = false;
if (form && form.$invalid) {
notification.error('Error', 'Please enter the required fields');
$scope.error = 'Please enter the required fields';
return;
}
$scope.loading = true;