add not available message
This commit is contained in:
parent
fee7034863
commit
8a88e712e1
4 changed files with 8 additions and 1 deletions
|
|
@ -42,6 +42,7 @@
|
||||||
<div class="item item-icon-left">
|
<div class="item item-icon-left">
|
||||||
<i class="icon ion-briefcase size-21"></i>
|
<i class="icon ion-briefcase size-21"></i>
|
||||||
<label translate>From</label>
|
<label translate>From</label>
|
||||||
|
<span class="badge badge-assertive" ng-show="content.notAvailable" translate>Not available</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<wallets only-complete="true" network="{{network}}" min-balance="{{minBalance}}"></wallets>
|
<wallets only-complete="true" network="{{network}}" min-balance="{{minBalance}}"></wallets>
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
|
$scope.notAvailable = false;
|
||||||
$scope.wallet = profileService.getWallets()[0];
|
$scope.wallet = profileService.getWallets()[0];
|
||||||
|
|
||||||
if ($stateParams.paypro) {
|
if ($stateParams.paypro) {
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
||||||
$log.debug('No wallet provided');
|
$log.debug('No wallet provided');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$scope.defaultWallet = wallet;
|
||||||
$log.debug('Wallet changed: ' + wallet.name);
|
$log.debug('Wallet changed: ' + wallet.name);
|
||||||
$scope.setAddress(wallet);
|
$scope.setAddress(wallet);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,7 @@ angular.module('copayApp.directives')
|
||||||
|
|
||||||
scope.content = {};
|
scope.content = {};
|
||||||
scope.content.wallets = [];
|
scope.content.wallets = [];
|
||||||
|
scope.content.notAvailable = false;
|
||||||
var minBalance = attrs.minBalance ? parseInt(attrs.minBalance) : 0;
|
var minBalance = attrs.minBalance ? parseInt(attrs.minBalance) : 0;
|
||||||
var wallets = profileService.getWallets(opts);
|
var wallets = profileService.getWallets(opts);
|
||||||
var filteredWallets = [];
|
var filteredWallets = [];
|
||||||
|
|
@ -182,13 +183,16 @@ angular.module('copayApp.directives')
|
||||||
if (!lodash.isEmpty(filteredWallets)) {
|
if (!lodash.isEmpty(filteredWallets)) {
|
||||||
scope.content.wallets = filteredWallets;
|
scope.content.wallets = filteredWallets;
|
||||||
scope.$emit('Wallet/Changed', scope.content.wallets[0]);
|
scope.$emit('Wallet/Changed', scope.content.wallets[0]);
|
||||||
|
} else {
|
||||||
|
scope.content.notAvailable = true;
|
||||||
|
$log.warn('No wallet available to make the payment');
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
walletService.getStatus(wallets[index], {}, function(err, status) {
|
walletService.getStatus(wallets[index], {}, function(err, status) {
|
||||||
if (err) $log.error(err);
|
if (err) $log.error(err);
|
||||||
if (!status.availableBalanceSat) $log.debug('Balance not available on wallet: ' + wallets[index].name);
|
if (!status.availableBalanceSat) $log.debug('No balance available in: ' + wallets[index].name);
|
||||||
if (status.availableBalanceSat > minBalance) filteredWallets.push(wallets[index]);
|
if (status.availableBalanceSat > minBalance) filteredWallets.push(wallets[index]);
|
||||||
index++;
|
index++;
|
||||||
filterWallet();
|
filterWallet();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue