Fix select wallet

This commit is contained in:
Gustavo Maximiliano Cortez 2016-07-14 11:54:01 -03:00
commit 42a8176d7c
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -35,19 +35,21 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
$scope.type = 'SELL'; $scope.type = 'SELL';
$scope.wallets = wallets; $scope.wallets = wallets;
$scope.self = self;
$ionicModal.fromTemplateUrl('views/modals/wallets.html', { $ionicModal.fromTemplateUrl('views/modals/wallets.html', {
scope: $scope scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) { }).then(function(modal) {
$scope.walletsModal = modal; $scope.walletsModal = modal;
$scope.walletsModal.show(); $scope.walletsModal.show();
}); });
$scope.$on('walletSelected', function(ev, obj) { $scope.$on('walletSelected', function(ev, walletId) {
$timeout(function() { $timeout(function() {
self.selectedWalletId = obj.walletId; client = profileService.getClient(walletId);
self.selectedWalletName = obj.walletName; self.selectedWalletId = walletId;
client = obj.client; self.selectedWalletName = client.credentials.walletName;
$scope.$apply(); $scope.$apply();
}, 100); }, 100);
$scope.walletsModal.hide(); $scope.walletsModal.hide();