add pin fixes

This commit is contained in:
Matias Alejo Garcia 2014-12-11 03:41:28 -03:00
commit a34171e8cd
3 changed files with 26 additions and 21 deletions

View file

@ -61,18 +61,20 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
$scope.error = 'Please enter the required fields';
return;
}
$scope.loading = true;
$rootScope.starting = true;
var credentials = pinService.get(pin, function(err, credentials) {
if (err || !credentials) {
$rootScope.starting = false;
$scope.loading = null;
$scope.error = 'Wrong PIN';
return;
}
$scope.open(credentials.email, credentials.password);
});
$timeout(function() {
$rootScope.$digest();
var credentials = pinService.get(pin, function(err, credentials) {
if (err || !credentials) {
$rootScope.starting = false;
$scope.loading = null;
$scope.error = 'Wrong PIN';
return;
}
$scope.open(credentials.email, credentials.password);
});
},1);
};