diff --git a/public/views/preferencesInformation.html b/public/views/preferencesInformation.html
index 05b3e2758..56eedefc4 100644
--- a/public/views/preferencesInformation.html
+++ b/public/views/preferencesInformation.html
@@ -113,7 +113,7 @@
Transaction history
-
-
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js
index a96a20c71..521c1ca36 100644
--- a/src/js/controllers/index.js
+++ b/src/js/controllers/index.js
@@ -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() {
var userLang = uxLanguage.update();
self.defaultLanguageIsoCode = userLang;
@@ -1018,6 +1005,16 @@ angular.module('copayApp.controllers').controller('indexController', function($r
};
// 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) {
self.updateColor();
$timeout(function() {
diff --git a/src/js/controllers/preferencesInformation.js b/src/js/controllers/preferencesInformation.js
index 6cf9f08e8..6dc5141be 100644
--- a/src/js/controllers/preferencesInformation.js
+++ b/src/js/controllers/preferencesInformation.js
@@ -95,8 +95,13 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
};
this.clearTransactionHistory = function() {
- storageService.removeTxHistory(c.walletId, function() {
- return;
+ storageService.removeTxHistory(c.walletId, function(err) {
+ if (err) return $log.err(err);
+
+ $timeout(function() {
+ $scope.$emit('Local/ClearHistory');
+ go.walletHome();
+ }, 100);
});
}
});