fix login / create form errors and confirmed messages
This commit is contained in:
parent
b0db87b288
commit
3360c31a12
10 changed files with 74 additions and 23 deletions
|
|
@ -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;
|
||||
|
|
|
|||
6
js/controllers/emailConfirmation.js
Normal file
6
js/controllers/emailConfirmation.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('EmailConfirmationController', function($scope, $rootScope, $location) {
|
||||
$rootScope.fromEmailConfirmation = true;
|
||||
$location.path('/');
|
||||
});
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue