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