Merge pull request #109 from isocolsky/fix/wallet-filter
Filter out unavailable wallets
This commit is contained in:
commit
a1fe2d4a69
1 changed files with 7 additions and 5 deletions
|
|
@ -120,12 +120,14 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
|
|
||||||
lodash.each(wallets, function(w) {
|
lodash.each(wallets, function(w) {
|
||||||
walletService.getStatus(w, {}, function(err, status) {
|
walletService.getStatus(w, {}, function(err, status) {
|
||||||
if (err) $log.error(err);
|
if (err || !status) {
|
||||||
if (!status.availableBalanceSat) $log.debug('No balance available in: ' + w.name);
|
$log.error(err);
|
||||||
if (status.availableBalanceSat > amount) filteredWallets.push(w);
|
} else {
|
||||||
|
if (!status.availableBalanceSat) $log.debug('No balance available in: ' + w.name);
|
||||||
|
if (status.availableBalanceSat > amount) filteredWallets.push(w);
|
||||||
|
}
|
||||||
|
|
||||||
if (++index == wallets.length) {
|
if (++index == wallets.length) {
|
||||||
|
|
||||||
if (!lodash.isEmpty(filteredWallets)) {
|
if (!lodash.isEmpty(filteredWallets)) {
|
||||||
$scope.wallets = lodash.clone(filteredWallets);
|
$scope.wallets = lodash.clone(filteredWallets);
|
||||||
$scope.notAvailable = false;
|
$scope.notAvailable = false;
|
||||||
|
|
@ -136,7 +138,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 10);
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue