refactor clear history method call
This commit is contained in:
parent
c20cccedc2
commit
7c21793236
3 changed files with 18 additions and 16 deletions
|
|
@ -113,7 +113,7 @@
|
||||||
<ul class="no-bullet m0 size-14">
|
<ul class="no-bullet m0 size-14">
|
||||||
<h4 class="title m0" translate>Transaction history</h4>
|
<h4 class="title m0" translate>Transaction history</h4>
|
||||||
<li class="line-b p20 oh">
|
<li class="line-b p20 oh">
|
||||||
<button class="black round small expand" ng-style="{'background-color':index.backgroundColor}" ng-click="info.clearTransactionHistory(); index.clearHistoryFeedback();">
|
<button class="black round small expand" ng-style="{'background-color':index.backgroundColor}" ng-click="info.clearTransactionHistory();">
|
||||||
<span translate>Clear history</span>
|
<span translate>Clear history</span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -910,19 +910,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.clearHistoryFeedback = function() {
|
|
||||||
self.txHistory = [];
|
|
||||||
$log.debug('The wallet transaction history has been deleted');
|
|
||||||
self.setOngoingProcess('deletingHistory', true);
|
|
||||||
|
|
||||||
self.updateHistory();
|
|
||||||
go.walletHome();
|
|
||||||
|
|
||||||
$timeout(function() {
|
|
||||||
self.setOngoingProcess('deletingHistory', false);
|
|
||||||
}, 2000);
|
|
||||||
};
|
|
||||||
|
|
||||||
self.setUxLanguage = function() {
|
self.setUxLanguage = function() {
|
||||||
var userLang = uxLanguage.update();
|
var userLang = uxLanguage.update();
|
||||||
self.defaultLanguageIsoCode = userLang;
|
self.defaultLanguageIsoCode = userLang;
|
||||||
|
|
@ -1018,6 +1005,16 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
};
|
};
|
||||||
|
|
||||||
// UX event handlers
|
// UX event handlers
|
||||||
|
$rootScope.$on('Local/ClearHistory', function(event, walletId) {
|
||||||
|
storageService.removeTxHistory(walletId, function(err) {
|
||||||
|
if (err) root.showErrorPopup(err);
|
||||||
|
|
||||||
|
$log.debug('The wallet transaction history has been deleted');
|
||||||
|
self.txHistory = [];
|
||||||
|
self.updateHistory();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$rootScope.$on('Local/ColorUpdated', function(event) {
|
$rootScope.$on('Local/ColorUpdated', function(event) {
|
||||||
self.updateColor();
|
self.updateColor();
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,13 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
||||||
};
|
};
|
||||||
|
|
||||||
this.clearTransactionHistory = function() {
|
this.clearTransactionHistory = function() {
|
||||||
storageService.removeTxHistory(c.walletId, function() {
|
storageService.removeTxHistory(c.walletId, function(err) {
|
||||||
return;
|
if (err) return $log.err(err);
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$emit('Local/ClearHistory');
|
||||||
|
go.walletHome();
|
||||||
|
}, 100);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue