fixed alternative amount in TXP view
This commit is contained in:
parent
37f2a27e79
commit
67b392bdc3
1 changed files with 10 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
$scope.isRateAvailable = false;
|
$scope.isRateAvailable = false;
|
||||||
$scope.rateService = rateService;
|
$scope.rateService = rateService;
|
||||||
|
|
||||||
|
$scope.alternativeCurrency = [];
|
||||||
|
|
||||||
|
|
||||||
rateService.whenAvailable(function() {
|
rateService.whenAvailable(function() {
|
||||||
|
|
@ -88,6 +89,15 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
return w && _.keys(w.addressBook).length > 0;
|
return w && _.keys(w.addressBook).length > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.amountAlternative = function(amount, txIndex, cb) {
|
||||||
|
var w = $rootScope.wallet;
|
||||||
|
rateService.whenAvailable(function() {
|
||||||
|
var valueSat = amount * w.settings.unitToSatoshi;
|
||||||
|
$scope.alternativeCurrency[txIndex] = rateService.toFiat(valueSat, w.settings.alternativeIsoCode);
|
||||||
|
return cb ? cb() : null;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
if ($rootScope.pendingPayment) {
|
if ($rootScope.pendingPayment) {
|
||||||
var pp = $rootScope.pendingPayment;
|
var pp = $rootScope.pendingPayment;
|
||||||
$scope.address = pp.address + '';
|
$scope.address = pp.address + '';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue