Merge pull request #2071 from cmgustavo/bug/pin-02

Bug/pin 02
This commit is contained in:
Matias Alejo Garcia 2014-12-09 19:19:20 -03:00
commit 16772c6f31
6 changed files with 12 additions and 8 deletions

View File

@ -198,10 +198,6 @@
padding: 1rem 1.2rem 1.0625rem; padding: 1rem 1.2rem 1.0625rem;
} }
form {
margin: 0;
}
.box-setup { .box-setup {
margin-bottom: 50px; margin-bottom: 50px;
} }

View File

@ -40,12 +40,14 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
preconditions.checkArgument(pin); preconditions.checkArgument(pin);
preconditions.checkState($rootScope.iden); preconditions.checkState($rootScope.iden);
preconditions.checkState(_credentials && _credentials.email); preconditions.checkState(_credentials && _credentials.email);
$scope.loading = true;
pinService.save(pin, _credentials.email, _credentials.password, function(err) { pinService.save(pin, _credentials.email, _credentials.password, function(err) {
_credentials.password = ''; _credentials.password = '';
_credentials = null; _credentials = null;
$scope.askForPin = 0; $scope.askForPin = 0;
$rootScope.hasPin = true; $rootScope.hasPin = true;
$scope.loading = null;
$scope.createDefaultWallet(); $scope.createDefaultWallet();
}); });
}; };
@ -106,7 +108,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
$scope.loading = true; $scope.loading = true;
identityService.create(emailOrUsername, password, function(err) { identityService.create(emailOrUsername, password, function(err) {
$scope.loading = false; $scope.loading = null;
$scope.error = null; $scope.error = null;
if (err) { if (err) {
var msg = err.toString(); var msg = err.toString();

View File

@ -67,6 +67,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
$scope.error = 'Please enter the required fields'; $scope.error = 'Please enter the required fields';
return; return;
} }
$scope.loading = true;
$rootScope.starting = true; $rootScope.starting = true;
var credentials = pinService.get(pin, function(err, credentials) { var credentials = pinService.get(pin, function(err, credentials) {
@ -93,12 +94,14 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
preconditions.checkArgument(pin); preconditions.checkArgument(pin);
preconditions.checkState($rootScope.iden); preconditions.checkState($rootScope.iden);
preconditions.checkState(_credentials && _credentials.email); preconditions.checkState(_credentials && _credentials.email);
$scope.loading = true;
pinService.save(pin, _credentials.email, _credentials.password, function(err) { pinService.save(pin, _credentials.email, _credentials.password, function(err) {
_credentials.password = ''; _credentials.password = '';
_credentials = null; _credentials = null;
$scope.askForPin = 0; $scope.askForPin = 0;
$rootScope.hasPin = true; $rootScope.hasPin = true;
$scope.loading = null;
$scope.openWallets(); $scope.openWallets();
}); });
}; };

View File

@ -59,7 +59,6 @@ angular.module('copayApp.services')
scope.error = null; scope.error = null;
scope.loading = null; scope.loading = null;
if (newValue && newValue.length == 4) { if (newValue && newValue.length == 4) {
scope.loading = true;
$timeout(function() { $timeout(function() {
return cb(newValue); return cb(newValue);
}, 30); }, 30);

View File

@ -233,7 +233,9 @@
</a> </a>
</div> </div>
<div class="large-6 medium-6 small-6 columns text-right"> <div class="large-6 medium-6 small-6 columns text-right">
<button translate type="submit" class="button primary radius expand m0" ng-disabled="setPinForm.$invalid || error"> <button translate type="submit" class="button primary radius expand m0"
ng-disabled="setPinForm.$invalid || error || loading">
<i class="fi-bitcoin-circle icon-rotate spinner" ng-show="loading"></i>
OK OK
</button> </button>
</div> </div>

View File

@ -68,7 +68,9 @@
</a> </a>
</div> </div>
<div class="large-6 medium-6 small-6 columns text-right"> <div class="large-6 medium-6 small-6 columns text-right">
<button translate type="submit" class="button primary radius expand m0" ng-disabled="setPinForm.$invalid || error"> <button translate type="submit" class="button primary radius expand m0"
ng-disabled="setPinForm.$invalid || error || loading">
<i class="fi-bitcoin-circle icon-rotate spinner" ng-show="loading"></i>
OK OK
</button> </button>
</div> </div>