diff --git a/index.html b/index.html index 290ce3bba..e62994346 100644 --- a/index.html +++ b/index.html @@ -489,9 +489,8 @@

Last transactions

- + +
No transactions yet. @@ -511,7 +510,7 @@
-
+

{{vin.addr}}

{{vin.value}}
diff --git a/js/controllers/transactions.js b/js/controllers/transactions.js index b97659d89..ede169280 100644 --- a/js/controllers/transactions.js +++ b/js/controllers/transactions.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copay.transactions').controller('TransactionsController', - function($scope, $rootScope, controllerUtils) { + function($scope, $rootScope, $timeout, controllerUtils) { $scope.title = 'Transactions'; $scope.loading = false; @@ -31,21 +31,21 @@ angular.module('copay.transactions').controller('TransactionsController', }; $scope.toogleLast = function () { - console.log('[toogleLast]'); - $scope.loading=true; + $scope.loading = true; $scope.lastShowed = !$scope.lastShowed; if ($scope.lastShowed) { $scope.getTransactions(function(txs){ - $scope.loading=false; - $scope.blockchain_txs = txs; - $rootScope.$digest(); + $timeout(function() { + $scope.loading = false; + $scope.blockchain_txs = txs; + $scope.$digest(); + }, 10); }); - } - else { - setTimeout(function(){ - $scope.loading=false; + } else { + $timeout(function(){ + $scope.loading = false; $rootScope.$digest(); - }); + }, 10); } }; @@ -90,7 +90,6 @@ angular.module('copay.transactions').controller('TransactionsController', $scope.getTransactions = function(cb) { var w =$rootScope.wallet; if (w) { - console.log('### Querying last transactions...'); //TODO var addresses = w.getAddressesStr(); if (addresses.length > 0) { diff --git a/js/filters.js b/js/filters.js index 258d22610..5954ea5d1 100644 --- a/js/filters.js +++ b/js/filters.js @@ -14,15 +14,22 @@ angular.module('copay.filters', []) return dic; } - var dic = inputs.reduce(reduce, {}); - return Object.keys(dic).map(function(key) { - return { addr: key, value: dic[key] }; - }); + var dic; + if (inputs) { + dic = inputs.reduce(reduce, {}); + return Object.keys(dic).map(function(key) { + return { addr: key, value: dic[key] }; + }); + } }; }) .filter('paged', function() { return function(elements) { - return elements.filter(Boolean); + if (elements) { + return elements.filter(Boolean); + } + + return false; }; }) .filter('limitAddress', function() {