From 7f684c8eb6cea79a01d25f681e60f61a06232b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 28 Dec 2016 12:11:55 -0300 Subject: [PATCH] improve confirm view UI --- src/js/controllers/confirm.js | 6 +++--- src/js/directives/clickToAccept.js | 4 +++- www/views/confirm.html | 12 ++++++++---- www/views/includes/clickToAccept.html | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index fe98906c6..f6264828a 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -63,9 +63,8 @@ angular.module('copayApp.controllers').controller('confirmController', function( if (!$scope.wallets || !$scope.wallets.length) { $scope.noMatchingWallet = true; - if ($scope.paypro) { - displayValues(); - } + displayValues(); + $log.warn('No ' + $scope.network + ' wallets to make the payment'); $timeout(function() { $scope.$apply(); }); @@ -107,6 +106,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( } else initConfirm(); } else { if (!enoughFunds) $scope.insufficientFunds = true; + displayValues(); $log.warn('No wallet available to make the payment'); } $timeout(function() { diff --git a/src/js/directives/clickToAccept.js b/src/js/directives/clickToAccept.js index 63257e235..2127075dd 100644 --- a/src/js/directives/clickToAccept.js +++ b/src/js/directives/clickToAccept.js @@ -8,7 +8,9 @@ angular.module('copayApp.directives') transclude: true, scope: { sendStatus: '=clickSendStatus', - wallet: '=hasWalletChosen' + hasWalletChosen: '=hasWalletChosen', + insufficientFunds: '=insufficientFunds', + noMatchingWallet: '=noMatchingWallet' }, link: function(scope, element, attrs) { scope.$watch('sendStatus', function() { diff --git a/www/views/confirm.html b/www/views/confirm.html index a3cef657d..71094eaca 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -120,17 +120,21 @@ + has-wallet-chosen="wallet" + insufficient-funds="insufficientFunds" + no-matching-wallet="noMatchingWallet"> {{'Accept' | translate}} + has-wallet-chosen="wallet" + insufficient-funds="insufficientFunds" + no-matching-wallet="noMatchingWallet"> {{'Accept' | translate}} +