add digest

This commit is contained in:
Matias Alejo Garcia 2014-11-01 21:49:49 -03:00
parent a097927a2f
commit a268c3c8eb
2 changed files with 15 additions and 6 deletions

View File

@ -218,6 +218,9 @@ angular.module('copayApp.services')
} else {
$location.path('/manage');
}
$timeout(function() {
$rootScope.$digest()
}, 0);
};
// On the focused wallet

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.services')
.factory('identityService', function($rootScope, $location, pluginManager, controllerUtils) {
.factory('identityService', function($rootScope, $location, $timeout, pluginManager, controllerUtils) {
var root = {};
root.check = function(scope) {
@ -41,6 +41,10 @@ angular.module('copayApp.services')
} else {
scope.error = 'Unknown error when connecting Insight Server';
}
$timeout(function() {
$rootScope.$digest()
}, 0);
return;
}
var walletOptions = {
@ -74,18 +78,20 @@ angular.module('copayApp.services')
walletDefaults: config.wallet,
passphraseConfig: config.passphraseConfig,
}, function(err, iden) {
scope.loading = false;
if (err && !iden) {
if ((err.toString() || '').match('PNOTFOUND')) {
scope.error = 'Invalid email or password';
}
else {
} else {
scope.error = 'Unknown error';
}
$timeout(function() {
$rootScope.$digest()
}, 0);
} else {
var firstWallet = iden.getLastFocusedWallet();
controllerUtils.bindProfile(scope, iden, firstWallet);
}
scope.loading = false;
});
};