remove unnecessary parameter
This commit is contained in:
parent
850739e17e
commit
1ca3f24fa7
1 changed files with 7 additions and 12 deletions
|
|
@ -84,7 +84,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
$scope.amount = (($stateParams.toAmount) * satToUnit).toFixed(unitDecimals);
|
$scope.amount = (($stateParams.toAmount) * satToUnit).toFixed(unitDecimals);
|
||||||
}
|
}
|
||||||
|
|
||||||
processAmount($scope.amount);
|
processAmount();
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$ionicScrollDelegate.resize();
|
$ionicScrollDelegate.resize();
|
||||||
|
|
@ -93,7 +93,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
|
|
||||||
function paste(value) {
|
function paste(value) {
|
||||||
$scope.amount = value;
|
$scope.amount = value;
|
||||||
processAmount(value);
|
processAmount();
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
});
|
});
|
||||||
|
|
@ -144,7 +144,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
|
|
||||||
$scope.amount = ($scope.amount + digit).replace('..', '.');
|
$scope.amount = ($scope.amount + digit).replace('..', '.');
|
||||||
checkFontSize();
|
checkFontSize();
|
||||||
processAmount($scope.amount);
|
processAmount();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.pushOperator = function(operator) {
|
$scope.pushOperator = function(operator) {
|
||||||
|
|
@ -172,7 +172,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
|
|
||||||
$scope.removeDigit = function() {
|
$scope.removeDigit = function() {
|
||||||
$scope.amount = $scope.amount.slice(0, -1);
|
$scope.amount = $scope.amount.slice(0, -1);
|
||||||
processAmount($scope.amount);
|
processAmount();
|
||||||
checkFontSize();
|
checkFontSize();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -182,17 +182,12 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
checkFontSize();
|
checkFontSize();
|
||||||
};
|
};
|
||||||
|
|
||||||
function processAmount(val) {
|
function processAmount() {
|
||||||
if (!val) {
|
var formatedValue = format($scope.amount);
|
||||||
$scope.resetAmount();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var formatedValue = format(val);
|
|
||||||
var result = evaluate(formatedValue);
|
var result = evaluate(formatedValue);
|
||||||
$scope.allowSend = lodash.isNumber(result) && +result > 0;
|
$scope.allowSend = lodash.isNumber(result) && +result > 0;
|
||||||
if (lodash.isNumber(result)) {
|
if (lodash.isNumber(result)) {
|
||||||
$scope.globalResult = isExpression(val) ? '= ' + processResult(result) : '';
|
$scope.globalResult = isExpression($scope.amount) ? '= ' + processResult(result) : '';
|
||||||
$scope.amountResult = $filter('formatFiatAmount')(toFiat(result));
|
$scope.amountResult = $filter('formatFiatAmount')(toFiat(result));
|
||||||
$scope.alternativeResult = txFormatService.formatAmount(fromFiat(result) * unitToSatoshi, true);
|
$scope.alternativeResult = txFormatService.formatAmount(fromFiat(result) * unitToSatoshi, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue