rename variables/event
This commit is contained in:
parent
e62e372a1a
commit
f3c9728890
2 changed files with 14 additions and 2 deletions
|
|
@ -926,7 +926,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
if (walletId == profileService.focusedClient.credentials.walletId) {
|
||||
self.completeHistory = newHistory;
|
||||
self.txHistory = newHistory.slice(0, self.historyShowLimit);
|
||||
self.historyShowShowAll = newHistory.length >= self.historyShowLimit;
|
||||
self.historyShowShowAll = newHistory.length > self.historyShowLimit;
|
||||
}
|
||||
|
||||
return storageService.setTxHistory(JSON.stringify(newHistory), walletId, function() {
|
||||
|
|
@ -935,6 +935,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
self.showAllHistory = function() {
|
||||
self.historyShowShowAll = false;
|
||||
self.historyRendering = true;
|
||||
|
|
@ -1177,6 +1178,15 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
};
|
||||
|
||||
$rootScope.$on('Local/UpdateTxHistory', function(event) {
|
||||
$timeout(function () {
|
||||
self.txHistory = self.completeHistory.slice(0, self.historyShowLimit);
|
||||
if (self.completeHistory.length > self.historyShowLimit)
|
||||
self.historyShowShowAll = true;
|
||||
}, 10);
|
||||
});
|
||||
|
||||
|
||||
$rootScope.$on('$stateChangeSuccess', function(ev, to, toParams, from, fromParams) {
|
||||
self.prevState = from.name || 'walletHome';
|
||||
self.tab = 'walletHome';
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('topbarController', function(go) {
|
||||
angular.module('copayApp.controllers').controller('topbarController', function(go, $rootScope) {
|
||||
|
||||
this.goHome = function() {
|
||||
$rootScope.$emit('Local/UpdateTxHistory');
|
||||
go.walletHome();
|
||||
};
|
||||
|
||||
this.goPreferences = function() {
|
||||
$rootScope.$emit('Local/UpdateTxHistory');
|
||||
go.preferences();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue