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';
|
'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 fromWalletId = '';
|
||||||
var priceDisplayAsFiat = false;
|
var priceDisplayAsFiat = false;
|
||||||
|
|
@ -116,15 +116,27 @@ angular.module('copayApp.controllers').controller('walletSelectorController', fu
|
||||||
if ($scope.type === 'origin') {
|
if ($scope.type === 'origin') {
|
||||||
$scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');
|
$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 = profileService.getWallets({coin: $scope.coin});
|
||||||
|
ongoingProcess.set('scanning', true);
|
||||||
walletsAll.forEach(function forWallet(wallet){
|
walletsAll.forEach(function forWallet(wallet) {
|
||||||
if (wallet.status.availableBalanceSat > $scope.params.amount) {
|
if (!wallet.status) {
|
||||||
walletsSufficientFunds.push(wallet);
|
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);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$scope.walletsInsufficientFunds.push(wallet);
|
if (wallet.status.availableBalanceSat > ($scope.params.amount ? $scope.params.amount : 0)) {
|
||||||
|
walletsSufficientFunds.push(wallet);
|
||||||
|
} else {
|
||||||
|
$scope.walletsInsufficientFunds.push(wallet);
|
||||||
|
}
|
||||||
|
ongoingProcess.set('scanning', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -133,22 +145,6 @@ angular.module('copayApp.controllers').controller('walletSelectorController', fu
|
||||||
} else {
|
} else {
|
||||||
$scope.walletsBch = walletsSufficientFunds;
|
$scope.walletsBch = walletsSufficientFunds;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ($scope.coin) {
|
|
||||||
walletsAll = profileService.getWallets({coin: $scope.coin});
|
|
||||||
walletsAll.forEach(function forWallet(wallet){
|
|
||||||
if (wallet.status.availableBalanceSat > 0) {
|
|
||||||
walletsSufficientFunds.push(wallet);
|
|
||||||
} else {
|
|
||||||
$scope.walletsInsufficientFunds.push(wallet);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if ($scope.coin === 'btc') {
|
|
||||||
$scope.walletsBtc = walletsSufficientFunds;
|
|
||||||
} else {
|
|
||||||
$scope.walletsBch = walletsSufficientFunds;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$scope.walletsBch = profileService.getWallets({coin: 'bch', hasFunds: true});
|
$scope.walletsBch = profileService.getWallets({coin: 'bch', hasFunds: true});
|
||||||
$scope.walletsBtc = profileService.getWallets({coin: 'btc', hasFunds: true});
|
$scope.walletsBtc = profileService.getWallets({coin: 'btc', hasFunds: true});
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<div class="header--request__amount-alt" ng-show="requestAmountSecondary" translate>{{requestAmountSecondary}} {{requestCurrencySecondary}}</div>
|
<div class="header--request__amount-alt" ng-show="requestAmountSecondary" translate>{{requestAmountSecondary}} {{requestCurrencySecondary}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wallets-header">
|
<div class="wallets-header">
|
||||||
<div class="title">
|
<div class="title" ng-if="walletsBch.length > 0 || walletsBtc.length > 0 || walletsInsufficientFunds.length > 0">
|
||||||
{{headerTitle}}
|
{{headerTitle}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue