more conflicts solved

This commit is contained in:
Gabriel Bazán 2016-02-23 11:29:11 -03:00
commit aed24f97b9

View file

@ -908,36 +908,32 @@ angular.module('copayApp.controllers').controller('indexController', function($r
} }
self.showMore = function() { self.showMore = function() {
if (self.isSearching) { $timeout(function() {
$timeout(function() { if (self.isSearching) {
self.txHistoryToList = self.result.slice(0, self.nextTxHistory); self.txHistoryToList = self.result.slice(0, self.nextTxHistory);
$log.debug('Total txs: ', self.txHistoryToList.length + '/' + self.result.length); } else {
self.nextTxHistory += self.historyShowMoreLimit; self.txHistory = self.completeHistory.slice(0, self.nextTxHistory);
if (self.txHistoryToList.length >= self.result.length) self.txHistoryToList = self.txHistory;
self.historyShowMore = false; }
}, 100); $log.debug('Total txs: ', self.txHistoryToList.length + '/' + self.result.length);
} else { self.nextTxHistory += self.historyShowMoreLimit;
$timeout(function() { if (self.txHistoryToList.length >= self.result.length)
self.txHistory = self.completeHistory.slice(0, self.nextTxHistory); self.historyShowMore = false;
self.txHistoryToList = self.txHistory; }, 100);
$log.debug('Total txs: ', self.txHistory.length + '/' + self.completeHistory.length);
self.nextTxHistory += self.historyShowMoreLimit;
if (self.txHistory.length >= self.completeHistory.length)
self.historyShowMore = false;
}, 100);
}
}; };
self.startSearch = function(){ self.startSearch = function(){
self.isSearching = true; self.isSearching = true;
self.txHistoryToList = []; self.txHistoryToList = [];
self.result = [];
self.historyShowMore = false; self.historyShowMore = false;
self.nextTxHistory = self.historyShowMoreLimit;
} }
self.cancelSearch = function(){ self.cancelSearch = function(){
self.isSearching = false; self.isSearching = false;
self.txHistoryToList = self.completeHistory.slice(0, self.historyShowLimit); self.result = [];
self.historyShowMore = self.completeHistory.length > self.historyShowLimit; self.setCompactTxHistory();
} }
self.updateSearchInput = function(search){ self.updateSearchInput = function(search){
@ -1233,7 +1229,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on('Local/ClearHistory', function(event) { $rootScope.$on('Local/ClearHistory', function(event) {
$log.debug('The wallet transaction history has been deleted'); $log.debug('The wallet transaction history has been deleted');
self.txHistory = self.completeHistory = []; self.txHistory = self.completeHistory = self.txHistoryToList = [];
self.debounceUpdateHistory(); self.debounceUpdateHistory();
}); });
@ -1378,7 +1374,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$log.debug('Backup done stored'); $log.debug('Backup done stored');
addressService.expireAddress(walletId, function(err) { addressService.expireAddress(walletId, function(err) {
$timeout(function() { $timeout(function() {
self.txHistory = self.completeHistory = []; self.txHistory = self.completeHistory = self.txHistoryToList = [];
storageService.removeTxHistory(walletId, function() { storageService.removeTxHistory(walletId, function() {
self.startScan(walletId); self.startScan(walletId);
}); });