loading new txs using pagination

This commit is contained in:
Sebastiaan Pasma 2018-08-15 17:23:00 +02:00
commit 0ae6f043ed
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F
3 changed files with 105 additions and 13 deletions

View file

@ -256,11 +256,18 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
return !tx.confirmations || tx.confirmations === 0;
};
var loadingTxs = false;
$scope.showMore = function() {
if (loadingTxs)
return;
loadingTxs = true;
$timeout(function() {
currentTxHistoryPage++;
$scope.showHistory();
$scope.$broadcast('scroll.infiniteScrollComplete');
walletService.getMoreTxs($scope.wallet, function() {
currentTxHistoryPage++;
$scope.showHistory();
$scope.$broadcast('scroll.infiniteScrollComplete');
loadingTxs = false;
});
}, 100);
};