Refactor call of .apply()

This commit is contained in:
Eric Larchevêque 2015-07-23 10:47:03 -07:00 committed by Matias Alejo Garcia
parent 239b5a5d9d
commit 0381e81de9
1 changed files with 2 additions and 2 deletions

View File

@ -67,17 +67,17 @@ angular.module('copayApp.controllers').controller('createController',
self.ledger = true;
ledger.getXPubKey($scope.externalIndex, function(data) {
self.ledger = false;
$scope.$apply();
if (data.success) {
$scope.$apply();
opts.extendedPublicKey = data.xpubkey;
opts.externalSource = 'ledger';
opts.externalIndex = $scope.externalIndex;
self._create(opts);
} else {
self.loading = false;
$log.debug(data.message);
self.error = data.message;
$scope.$apply();
$log.debug(data.message);
}
});
} else {