change variable name and fix more error

This commit is contained in:
Gabriel Bazán 2016-02-23 15:50:46 -03:00
parent 39b4012531
commit 1d097de0f4
2 changed files with 15 additions and 12 deletions

View File

@ -217,7 +217,7 @@
<a ng-click="index.cancelSearch()" translate>Cancel</a>
</div>
</div>
<div ng-repeat="btx in index.txHistoryToList track by btx.txid"
<div ng-repeat="btx in index.txHistorySearchResults track by btx.txid"
ng-click="home.openTxModal(btx)"
class="row collapse last-transactions-content">
<div class="large-6 medium-6 small-6 columns size-14">
@ -288,7 +288,7 @@
<a class="text-gray size-12"
ng-show="index.historyShowMore && index.isSearching"
ng-click="index.showMore()">
{{index.result.length - index.txHistoryToList.length}} <span translate>more</span>
{{index.result.length - index.txHistorySearchResults.length}} <span translate>more</span>
<i class="icon-arrow-down4"></i>
</a>
</div>

View File

@ -910,21 +910,24 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.showMore = function() {
$timeout(function() {
if (self.isSearching) {
self.txHistoryToList = self.result.slice(0, self.nextTxHistory);
self.txHistorySearchResults = self.result.slice(0, self.nextTxHistory);
$log.debug('Total txs: ', self.txHistorySearchResults.length + '/' + self.result.length);
if (self.txHistorySearchResults.length >= self.result.length)
self.historyShowMore = false;
} else {
self.txHistory = self.completeHistory.slice(0, self.nextTxHistory);
self.txHistoryToList = self.txHistory;
self.txHistorySearchResults = self.txHistory;
$log.debug('Total txs: ', self.txHistorySearchResults.length + '/' + self.completeHistory.length);
if (self.txHistorySearchResults.length >= self.completeHistory.length)
self.historyShowMore = false;
}
$log.debug('Total txs: ', self.txHistoryToList.length + '/' + self.result.length);
self.nextTxHistory += self.historyShowMoreLimit;
if (self.txHistoryToList.length >= self.result.length)
self.historyShowMore = false;
}, 100);
};
self.startSearch = function(){
self.isSearching = true;
self.txHistoryToList = [];
self.txHistorySearchResults = [];
self.result = [];
self.historyShowMore = false;
self.nextTxHistory = self.historyShowMoreLimit;
@ -973,7 +976,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
return self.result;
};
self.txHistoryToList = filter(self.search).slice(0, self.historyShowLimit);
self.txHistorySearchResults = filter(self.search).slice(0, self.historyShowLimit);
if (isCordova)
window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.result.length));
@ -1037,7 +1040,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.isSearching = false;
self.nextTxHistory = self.historyShowMoreLimit;
self.txHistory = self.completeHistory.slice(0, self.historyShowLimit);
self.txHistoryToList = self.txHistory;
self.txHistorySearchResults = self.txHistory;
self.historyShowMore = self.completeHistory.length > self.historyShowLimit;
};
@ -1233,7 +1236,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on('Local/ClearHistory', function(event) {
$log.debug('The wallet transaction history has been deleted');
self.txHistory = self.completeHistory = self.txHistoryToList = [];
self.txHistory = self.completeHistory = self.txHistorySearchResults = [];
self.debounceUpdateHistory();
});
@ -1374,7 +1377,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$log.debug('Backup done stored');
addressService.expireAddress(walletId, function(err) {
$timeout(function() {
self.txHistory = self.completeHistory = self.txHistoryToList = [];
self.txHistory = self.completeHistory = self.txHistorySearchResults = [];
storageService.removeTxHistory(walletId, function() {
self.startScan(walletId);
});