From 67b392bdc338192f3fa6a68fbe598d40a6af6f68 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Mon, 3 Nov 2014 16:53:57 -0300 Subject: [PATCH] fixed alternative amount in TXP view --- js/controllers/send.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/controllers/send.js b/js/controllers/send.js index cba594c7b..3d6a0b00e 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -24,6 +24,7 @@ angular.module('copayApp.controllers').controller('SendController', $scope.isRateAvailable = false; $scope.rateService = rateService; + $scope.alternativeCurrency = []; rateService.whenAvailable(function() { @@ -88,6 +89,15 @@ angular.module('copayApp.controllers').controller('SendController', 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) { var pp = $rootScope.pendingPayment; $scope.address = pp.address + '';