From 38852d32d4b300d82e8251b5a28a0f26cdc8b6f6 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 7 Aug 2018 11:59:36 +1200 Subject: [PATCH] Sending BIP70 payments. --- src/js/controllers/amount.js | 6 ++++-- src/js/controllers/review.controller.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index c53d49061..e6913a2cb 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -365,7 +365,8 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory, vm.alternativeAmount = txFormatService.formatAmount(amountInSatoshis, true); vm.allowSend = lodash.isNumber(a) && a > 0 - && (a >= vm.minAmount && a <= vm.maxAmount) + && (!vm.minAmount || a >= vm.minAmount) + && (!vm.maxAmount || a <= vm.maxAmount) && !vm.fundsAreInsufficient; } else { if (result) { @@ -385,7 +386,8 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory, vm.alternativeAmount = $filter('formatFiatAmount')(toFiat(result)); vm.allowSend = lodash.isNumber(result) && result > 0 - && (result >= vm.minAmount && result <= vm.maxAmount) + && (!vm.minAmount || result >= vm.minAmount) + && (!vm.maxAmount || result <= vm.maxAmount) && !vm.fundsAreInsufficient; } diff --git a/src/js/controllers/review.controller.js b/src/js/controllers/review.controller.js index 49c4d51ab..73af91188 100644 --- a/src/js/controllers/review.controller.js +++ b/src/js/controllers/review.controller.js @@ -110,13 +110,14 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit } vm.approve = function() { + if (vm.thirdParty.id === 'shapeshift') return; if (!tx || !vm.originWallet) return; - if ($scope.paymentExpired) { + if (vm.paymentExpired) { popupService.showAlert(null, gettextCatalog.getString('This bitcoin payment request has expired.')); - $scope.sendStatus = ''; + vm.sendStatus = ''; $timeout(function() { $scope.$apply(); }); @@ -445,6 +446,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit function handleThirdPartyInitIfBip70() { if (vm.thirdParty.id === 'bip70') { + vm.sendingTitle = gettextCatalog.getString('You are paying'); vm.memo = vm.thirdParty.memo; vm.memoExpanded = !!vm.memo;