balance Service

This commit is contained in:
Matias Alejo Garcia 2014-11-29 18:35:48 -03:00
commit 57299d675e
31 changed files with 585 additions and 645 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('JoinController',
function($scope, $rootScope, $timeout, isMobile, controllerUtils, notification) {
function($scope, $rootScope, $timeout, isMobile, notification) {
$rootScope.fromSetup = false;
$scope.loading = false;
$scope.isMobile = isMobile.any();
@ -119,31 +119,12 @@ angular.module('copayApp.controllers').controller('JoinController',
}
$scope.loading = true;
$rootScope.iden.joinWallet({
identityService.joinWallet({
secret: $scope.connectionId,
nickname: $scope.nickname,
privateHex: $scope.private,
}, function(err, w) {
}, function(err) {
$scope.loading = false;
if (err || !w) {
if (err === 'joinError')
notification.error('Fatal error connecting to Insight server');
else if (err === 'walletFull')
notification.error('The wallet is full');
else if (err === 'badNetwork')
notification.error('Network Error', 'Wallet network configuration missmatch');
else if (err === 'badSecret')
notification.error('Bad secret', 'The secret string you entered is invalid');
else {
notification.error('Error', err.message || err);
}
controllerUtils.onErrorDigest();
} else {
controllerUtils.installWalletHandlers($scope, w);
controllerUtils.setFocusedWallet(w);
}
});
}
});