From 0bd94601aed7e3714b41e69667d5c08e78b5f218 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 21 Aug 2018 09:17:56 +1200 Subject: [PATCH] Controlling when infinite scroll is available. --- src/js/controllers/walletDetails.js | 7 +++++-- www/views/walletDetails.html | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 59c0ddb20..173cb73d2 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -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; } } diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index ea1afb197..cb250a0ed 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -306,7 +306,7 @@