refactor buy init function

This commit is contained in:
Gabriel Bazán 2016-08-04 13:54:31 -03:00 committed by Gustavo Maximiliano Cortez
commit da4d8274ff
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -19,13 +19,18 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
amazonService.setCredentials(network); amazonService.setCredentials(network);
self.allWallets = profileService.getWallets(network, 1); self.allWallets = profileService.getWallets(network, 1);
client = profileService.focusedClient; client = profileService.focusedClient;
if (client && client.credentials.m == 1 && client.credentials.network == network) {
$timeout(function() { if (!client) return;
self.selectedWalletId = client.credentials.walletId;
self.selectedWalletName = client.credentials.walletName; if (lodash.isEmpty(self.allWallets)) return;
$scope.$apply();
}, 100); if (client.credentials.network != network) return;
}
$timeout(function() {
self.selectedWalletId = client.credentials.walletId;
self.selectedWalletName = client.credentials.walletName;
$scope.$apply();
}, 100);
}; };
$scope.openWalletsModal = function(wallets) { $scope.openWalletsModal = function(wallets) {