fixed shapeshift amount bug for fiat
This commit is contained in:
parent
0460df5719
commit
1b7a51ab68
1 changed files with 6 additions and 3 deletions
|
|
@ -334,9 +334,6 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
$scope.processAmount = function() {
|
$scope.processAmount = function() {
|
||||||
var formatedValue = format($scope.amountModel.amount);
|
var formatedValue = format($scope.amountModel.amount);
|
||||||
var result = evaluate(formatedValue);
|
var result = evaluate(formatedValue);
|
||||||
$scope.allowSend = lodash.isNumber(result) && +result > 0
|
|
||||||
&& (!$scope.shapeshiftOrderId
|
|
||||||
|| (result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount));
|
|
||||||
|
|
||||||
if (lodash.isNumber(result)) {
|
if (lodash.isNumber(result)) {
|
||||||
$scope.globalResult = isExpression($scope.amountModel.amount) ? '= ' + processResult(result) : '';
|
$scope.globalResult = isExpression($scope.amountModel.amount) ? '= ' + processResult(result) : '';
|
||||||
|
|
@ -346,6 +343,9 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
var a = fromFiat(result);
|
var a = fromFiat(result);
|
||||||
if (a) {
|
if (a) {
|
||||||
$scope.alternativeAmount = txFormatService.formatAmount(a * unitToSatoshi, true);
|
$scope.alternativeAmount = txFormatService.formatAmount(a * unitToSatoshi, true);
|
||||||
|
$scope.allowSend = lodash.isNumber(a) && a > 0
|
||||||
|
&& (!$scope.shapeshiftOrderId
|
||||||
|
|| (a >= $scope.minShapeshiftAmount && a <= $scope.maxShapeshiftAmount));
|
||||||
} else {
|
} else {
|
||||||
if (result) {
|
if (result) {
|
||||||
$scope.alternativeAmount = 'N/A';
|
$scope.alternativeAmount = 'N/A';
|
||||||
|
|
@ -356,6 +356,9 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$scope.alternativeAmount = $filter('formatFiatAmount')(toFiat(result));
|
$scope.alternativeAmount = $filter('formatFiatAmount')(toFiat(result));
|
||||||
|
$scope.allowSend = lodash.isNumber(result) && result > 0
|
||||||
|
&& (!$scope.shapeshiftOrderId
|
||||||
|
|| (result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue