refactor buy init function
This commit is contained in:
parent
98c59b611b
commit
da4d8274ff
1 changed files with 12 additions and 7 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue