From 1af5d6dd5f9469d7b2ae4d61af61e342a76e677a Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 10 Oct 2016 13:57:25 -0300 Subject: [PATCH 1/2] better message for "no enough funds" --- src/js/controllers/confirm.js | 21 ++++++++++++++++----- www/views/confirm.html | 14 ++++++++++---- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 868a45856..870febb2d 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -41,14 +41,20 @@ angular.module('copayApp.controllers').controller('confirmController', function( var networkName = (new bitcore.Address($scope.toAddress)).network.name; $scope.network = networkName; - $scope.notAvailable = false; + $scope.insuffientFunds = false; + $scope.noMatchingWallet = false; + var wallets = profileService.getWallets({ onlyComplete: true, network: networkName, }); + if (!wallets || !wallets.length) { + $scope.noMatchingWallet = true; + } + var filteredWallets = []; - var index = 0; + var index = 0, enoughFunds = false; lodash.each(wallets, function(w) { walletService.getStatus(w, {}, function(err, status) { @@ -56,15 +62,20 @@ angular.module('copayApp.controllers').controller('confirmController', function( $log.error(err); } else { if (!status.availableBalanceSat) $log.debug('No balance available in: ' + w.name); - if (status.availableBalanceSat > $scope.toAmount) filteredWallets.push(w); + if (status.availableBalanceSat > $scope.toAmount) { + filteredWallets.push(w); + enoughFunds = true; + } } if (++index == wallets.length) { if (!lodash.isEmpty(filteredWallets)) { $scope.wallets = lodash.clone(filteredWallets); - $scope.notAvailable = false; } else { - $scope.notAvailable = true; + + if (!enoughFunds) + $scope.insuffientFunds = true; + $log.warn('No wallet available to make the payment'); } } diff --git a/www/views/confirm.html b/www/views/confirm.html index aa039f4b4..0577b8ab6 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -45,13 +45,19 @@ -
- No wallet with enough funds +
+ No appropiate wallet to make this payment +
+ + + +
+ Insufficient funds
-
+
Add description @@ -59,7 +65,7 @@
- + From 52f8888a949627e98c91262e43279cc0e56940e1 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 10 Oct 2016 14:12:25 -0300 Subject: [PATCH 2/2] fix arrow direction --- www/views/tab-home.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/views/tab-home.html b/www/views/tab-home.html index b43869c56..35b92c244 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -126,8 +126,8 @@ ng-show="nextStepEnabled && wallets[0]">
Next steps - - + +