Displaying more cached data while waiting for first tx history fetch.
This commit is contained in:
parent
745737ef73
commit
e6beb6fed1
1 changed files with 7 additions and 6 deletions
|
|
@ -267,7 +267,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
}
|
||||
|
||||
if (fetchedAllTransactions) {
|
||||
console.log("All transactions seem to be fetched..");
|
||||
console.log("pagination Fetched all transactions.");
|
||||
$scope.vm.fetchedAllTxHistory = true;
|
||||
}
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
function showHistory(showAll) {
|
||||
if (completeTxHistory) {
|
||||
$scope.txHistory = showAll ? completeTxHistory : completeTxHistory.slice(0, (currentTxHistoryDisplayPage + 1) * DISPLAY_PAGE_SIZE);
|
||||
$scope.vm.allowInfiniteScroll = !$scope.vm.fetchedAllTxHistory;//(completeTxHistory.length > $scope.txHistory.length || !$scope.vm.gettingInitialHistory) || (!$scope.vm.gettingInitialHistory && !$scope.vm.fetchedAllTxHistory);
|
||||
$scope.vm.allowInfiniteScroll = !$scope.vm.fetchedAllTxHistory && !(completeTxHistory.length === $scope.txHistory.length && $scope.vm.gettingInitialHistory);
|
||||
console.log('pagination Showing txs: ', $scope.txHistory.length);
|
||||
} else {
|
||||
$scope.vm.allowInfiniteScroll = false;
|
||||
|
|
@ -332,18 +332,19 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
// on-infinite="showMore()"
|
||||
$scope.showMore = function() {
|
||||
console.log('pagination showMore()');
|
||||
if ($scope.vm.updatingTxHistory) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if we have more than we are displaying
|
||||
if (completeTxHistory.length > $scope.txHistory.length) {
|
||||
console.log('pagination We have more data than we are displaying.');
|
||||
currentTxHistoryDisplayPage++;
|
||||
showHistory(false);
|
||||
$scope.$broadcast('scroll.infiniteScrollComplete');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($scope.vm.updatingTxHistory) {
|
||||
return;
|
||||
}
|
||||
|
||||
fetchAndShowTxHistory(false, false);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue