Empty origin wallet screen bug
This commit is contained in:
parent
a54b30f6ae
commit
ad4aa76902
2 changed files with 20 additions and 24 deletions
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('walletSelectorController', function($scope, $state, sendFlowService, configService, gettextCatalog, profileService, txFormatService) {
|
||||
angular.module('copayApp.controllers').controller('walletSelectorController', function($scope, $state, sendFlowService, configService, gettextCatalog, ongoingProcess, profileService, walletService, txFormatService) {
|
||||
|
||||
var fromWalletId = '';
|
||||
var priceDisplayAsFiat = false;
|
||||
|
|
@ -116,32 +116,28 @@ angular.module('copayApp.controllers').controller('walletSelectorController', fu
|
|||
if ($scope.type === 'origin') {
|
||||
$scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');
|
||||
|
||||
if ($scope.params.amount) {
|
||||
if ($scope.params.amount || $scope.coin) {
|
||||
|
||||
walletsAll = profileService.getWallets({coin: $scope.coin});
|
||||
|
||||
walletsAll.forEach(function forWallet(wallet){
|
||||
if (wallet.status.availableBalanceSat > $scope.params.amount) {
|
||||
ongoingProcess.set('scanning', true);
|
||||
walletsAll.forEach(function forWallet(wallet) {
|
||||
if (!wallet.status) {
|
||||
walletService.getStatus(wallet, {}, function(err, status) {
|
||||
if (status.availableBalanceSat > ($scope.params.amount ? $scope.params.amount : 0)) {
|
||||
walletsSufficientFunds.push(wallet);
|
||||
} else {
|
||||
$scope.walletsInsufficientFunds.push(wallet);
|
||||
}
|
||||
ongoingProcess.set('scanning', false);
|
||||
});
|
||||
|
||||
if ($scope.coin === 'btc') {
|
||||
$scope.walletsBtc = walletsSufficientFunds;
|
||||
} else {
|
||||
$scope.walletsBch = walletsSufficientFunds;
|
||||
}
|
||||
|
||||
} else if ($scope.coin) {
|
||||
walletsAll = profileService.getWallets({coin: $scope.coin});
|
||||
walletsAll.forEach(function forWallet(wallet){
|
||||
if (wallet.status.availableBalanceSat > 0) {
|
||||
if (wallet.status.availableBalanceSat > ($scope.params.amount ? $scope.params.amount : 0)) {
|
||||
walletsSufficientFunds.push(wallet);
|
||||
} else {
|
||||
$scope.walletsInsufficientFunds.push(wallet);
|
||||
}
|
||||
ongoingProcess.set('scanning', false);
|
||||
}
|
||||
});
|
||||
|
||||
if ($scope.coin === 'btc') {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<div class="header--request__amount-alt" ng-show="requestAmountSecondary" translate>{{requestAmountSecondary}} {{requestCurrencySecondary}}</div>
|
||||
</div>
|
||||
<div class="wallets-header">
|
||||
<div class="title">
|
||||
<div class="title" ng-if="walletsBch.length > 0 || walletsBtc.length > 0 || walletsInsufficientFunds.length > 0">
|
||||
{{headerTitle}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue