Skip to content

Commit

Permalink
make bookkeeping of chosen rows local.
Browse files Browse the repository at this point in the history
  • Loading branch information
caedesvvv committed Apr 19, 2014
1 parent 9fb624b commit 1470226
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/frontend/controllers/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ function (controllers, Bitcoin, BtcUtils, DarkWallet, MultisigFund, Port) {

// Filters

var shownRows = [];
// Filter the rows we want to show
var chooseRows = function() {
var history = $scope.identity.history.history;
Expand All @@ -156,11 +155,11 @@ function (controllers, Bitcoin, BtcUtils, DarkWallet, MultisigFund, Port) {
}
return b.height - a.height;
});
rows = rows.filter($scope.historyFilter);
var shownRows = [];
rows = rows.filter(function(row) { return $scope.historyFilter(row, shownRows) } );
if (!rows.length) {
return [];
}

// Now calculate balances
var prevRow = rows[0];
prevRow.confirmed = $scope.balance;
Expand Down Expand Up @@ -223,7 +222,7 @@ function (controllers, Bitcoin, BtcUtils, DarkWallet, MultisigFund, Port) {
$scope.pocketFilter = function(row) {
return pocketFilter(row);
};
$scope.historyFilter = function(row) {
$scope.historyFilter = function(row, shownRows) {
if (!row.height) {
shownRows.push(row.hash);
return true;
Expand Down

0 comments on commit 1470226

Please sign in to comment.