open wallet working

This commit is contained in:
Matias Alejo Garcia 2014-04-15 15:25:55 -03:00
commit 341c9d8ffa
6 changed files with 54 additions and 12 deletions

View file

@ -7,6 +7,8 @@ angular.module('copay.signin').controller('SigninController',
// $rootScope.peerId = peerData ? peerData.peerId : null;
$scope.loading = false;
$scope.selectedWalletId = false;
$scope.listWalletIds = function() {
return copay.Wallet.factory.getWalletIds();
};
@ -23,12 +25,20 @@ angular.module('copay.signin').controller('SigninController',
$scope.open = function(walletId) {
$scope.loading = true;
if (Network.openWallet(walletId)) {
Network.openWallet(walletId);
if ($rootScope.wallet && $rootScope.wallet.id) {
Network.init(function() {
$location.path('peer');
$rootScope.$digest();
});
}
else {
$scope.loading = false;
$rootScope.flashMessage = {type:'error', message: 'Wallet not found'};
$location.path('signin');
}
};
$scope.join = function(cid) {

View file

@ -23,5 +23,5 @@ angular.module('copay.transactions').controller('TransactionsController',
}
];
$scope.txsoutput = $rootScope.wallet.txProposals.txps;
$scope.txsoutput = $rootScope.wallet.getTxProposals();
});