From 6d72d00b998a17980b3c4117c14f601713e65804 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 1 Dec 2014 01:27:58 -0300 Subject: [PATCH] Define rateService on history.js. Fix filter noFractionNumber if alternativeAmount is null. --- js/controllers/history.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/controllers/history.js b/js/controllers/history.js index 2779705f9..97836d698 100644 --- a/js/controllers/history.js +++ b/js/controllers/history.js @@ -2,7 +2,7 @@ var bitcore = require('bitcore'); angular.module('copayApp.controllers').controller('HistoryController', - function($scope, $rootScope, $filter) { + function($scope, $rootScope, $filter, rateService) { var w = $rootScope.wallet; $rootScope.title = 'History'; @@ -146,9 +146,8 @@ angular.module('copayApp.controllers').controller('HistoryController', if (!err && res) { _.each(res, function(r) { var tx = index[r.ts]; - tx.alternativeAmount = $filter('noFractionNumber')( - (r.rate != null ? tx.amountSat * rateService.SAT_TO_BTC * r.rate : null)) - ; + var alternativeAmount = (r.rate != null ? tx.amountSat * rateService.SAT_TO_BTC * r.rate : null); + tx.alternativeAmount = alternativeAmount ? $filter('noFractionNumber')(alternativeAmount) : null; }); setTimeout(function() { $scope.$digest();