Merge pull request #2108 from matiu/bug/pin-display

Bug/pin display
This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-11 03:42:48 -03:00
commit 2d5b5318b8
4 changed files with 27 additions and 22 deletions

View file

@ -45,6 +45,9 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
preconditions.checkState(_credentials && _credentials.email); preconditions.checkState(_credentials && _credentials.email);
$scope.loading = true; $scope.loading = true;
$timeout(function() {
$rootScope.$digest();
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;
@ -53,6 +56,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
$scope.loading = null; $scope.loading = null;
$scope.createDefaultWallet(); $scope.createDefaultWallet();
}); });
}, 1);
}; };

View file

@ -61,9 +61,10 @@ 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;
$timeout(function() {
$rootScope.$digest();
var credentials = pinService.get(pin, function(err, credentials) { var credentials = pinService.get(pin, function(err, credentials) {
if (err || !credentials) { if (err || !credentials) {
$rootScope.starting = false; $rootScope.starting = false;
@ -73,6 +74,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
} }
$scope.open(credentials.email, credentials.password); $scope.open(credentials.email, credentials.password);
}); });
},1);
}; };

View file

@ -7,7 +7,7 @@ angular.module('copayApp.services')
root.restart = function() { root.restart = function() {
if (isCordova) { if (isCordova) {
$rootScope.iden = $rootScope.wallet = undefined; $rootScope.iden = $rootScope.wallet = undefined;
go.go('/'); go.path('/');
$timeout(function(){ $timeout(function(){
$rootScope.$digest(); $rootScope.$digest();
},1); },1);

View file

@ -109,8 +109,7 @@
</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" <button translate type="submit" class="button primary radius expand m0"
ng-disabled="pinForm.$invalid || error || loading"> ng-disabled="pinForm.$invalid || error">
<i class="fi-bitcoin-circle icon-rotate spinner" ng-show="loading"></i>
Sign in Sign in
</button> </button>
</div> </div>