From 1b7a51ab686c142312ea80801cb249f8f0138a61 Mon Sep 17 00:00:00 2001 From: Kadir Sekha Date: Mon, 19 Feb 2018 20:12:37 +0530 Subject: [PATCH] fixed shapeshift amount bug for fiat --- src/js/controllers/amount.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index bd7973fc8..15d7b27e6 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -334,9 +334,6 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.processAmount = function() { var formatedValue = format($scope.amountModel.amount); var result = evaluate(formatedValue); - $scope.allowSend = lodash.isNumber(result) && +result > 0 - && (!$scope.shapeshiftOrderId - || (result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount)); if (lodash.isNumber(result)) { $scope.globalResult = isExpression($scope.amountModel.amount) ? '= ' + processResult(result) : ''; @@ -346,6 +343,9 @@ angular.module('copayApp.controllers').controller('amountController', function($ var a = fromFiat(result); if (a) { $scope.alternativeAmount = txFormatService.formatAmount(a * unitToSatoshi, true); + $scope.allowSend = lodash.isNumber(a) && a > 0 + && (!$scope.shapeshiftOrderId + || (a >= $scope.minShapeshiftAmount && a <= $scope.maxShapeshiftAmount)); } else { if (result) { $scope.alternativeAmount = 'N/A'; @@ -356,6 +356,9 @@ angular.module('copayApp.controllers').controller('amountController', function($ } } else { $scope.alternativeAmount = $filter('formatFiatAmount')(toFiat(result)); + $scope.allowSend = lodash.isNumber(result) && result > 0 + && (!$scope.shapeshiftOrderId + || (result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount)); } } };