fix UI - fix set form (alt amount)

This commit is contained in:
Javier 2016-07-19 17:10:40 -03:00
commit 9bf571bdd7
3 changed files with 62 additions and 30 deletions

View file

@ -346,6 +346,18 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
}, 1);
};
this.setAmount = function(amount, alternativeAmount, useAlternativeAmount) {
var amountResult;
if (useAlternativeAmount) {
amountResult = parseFloat((rateService.fromFiat(alternativeAmount, self.alternativeIsoCode) * self.satToUnit).toFixed(self.unitDecimals), 10);
$scope.showAlternative = true;
} else {
amountResult = amount;
$scope.showAlternative = false;
}
self.setForm(null, amountResult, null);
};
this.submitForm = function() {
if (!$scope._amount || !$scope._address) return;
var client = profileService.focusedClient;