Controlling when infinite scroll is available.
This commit is contained in:
parent
72cb94d212
commit
0bd94601ae
2 changed files with 6 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
|
||||
// For gradual migration for doing it properly
|
||||
$scope.vm = {
|
||||
allowInfiniteScroll: false,
|
||||
gettingCachedHistory: true,
|
||||
gettingInitialHistory: true,
|
||||
updatingTxHistory: false,
|
||||
|
|
@ -35,7 +36,6 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
// of everything we have, not the complete history.
|
||||
$scope.txHistory = []; // This is what is displayed
|
||||
$scope.txHistorySearchResults = [];
|
||||
//$scope.txHistoryShowMore = false; // Is this used anywhere?
|
||||
$scope.txps = [];
|
||||
$scope.updatingStatus = false;
|
||||
$scope.updateStatusError = null;
|
||||
|
|
@ -258,6 +258,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
function updateTxHistoryUsingCachedData() {
|
||||
walletHistoryService.getCachedTxHistory($scope.wallet.id, function onGetCachedTxHistory(err, txHistory){
|
||||
$scope.vm.gettingCachedHistory = false;
|
||||
|
|
@ -313,7 +314,9 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
function showHistory() {
|
||||
if (completeTxHistory) {
|
||||
$scope.txHistory = completeTxHistory.slice(0, (currentTxHistoryDisplayPage + 1) * DISPLAY_PAGE_SIZE);
|
||||
$scope.txHistoryShowMore = completeTxHistory.length > $scope.txHistory.length;
|
||||
$scope.vm.allowInfiniteScroll = completeTxHistory.length > $scope.txHistory.length || !$scope.vm.gettingInitialHistory;
|
||||
} else {
|
||||
$scope.vm.allowInfiniteScroll = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<ion-infinite-scroll
|
||||
ng-if="txHistory[0]"
|
||||
ng-if="txHistory[0] && vm.allowInfiniteScroll"
|
||||
on-infinite="showMore()"
|
||||
distance="1%">
|
||||
</ion-infinite-scroll>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue