From 3e8ce8854ff4c973efd8c60ef5ed12c9c41acf98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 2 Sep 2016 16:05:25 -0300 Subject: [PATCH] clear history on settings --- src/js/controllers/export.js | 3 ++- src/js/controllers/paperWallet.js | 3 ++- src/js/controllers/paymentUri.js | 3 ++- src/js/controllers/preferencesDelete.js | 3 ++- src/js/controllers/preferencesHistory.js | 3 ++- src/js/controllers/preferencesInformation.js | 4 +++- src/js/services/applicationService.js | 3 ++- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js index 0a0690e85..1e4d78e47 100644 --- a/src/js/controllers/export.js +++ b/src/js/controllers/export.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('exportController', - function($rootScope, $scope, $timeout, $log, lodash, backupService, walletService, storageService, profileService, platformInfo, gettext, gettextCatalog, $state, $stateParams, popupService) { + function($rootScope, $scope, $timeout, $log, $ionicHistory, lodash, backupService, walletService, storageService, profileService, platformInfo, gettext, gettextCatalog, $state, $stateParams, popupService) { var prevState; var isWP = platformInfo.isWP; var isAndroid = platformInfo.isAndroid; @@ -63,6 +63,7 @@ angular.module('copayApp.controllers').controller('exportController', popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Failed to export')); return; } + $ionicHistory.clearHistory(); $state.go('tabs.home'); }); }); diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index db0d21bca..6393fdc3f 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,5 +1,5 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $timeout, $log, $ionicModal, configService, profileService, $state, addressService, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { + function($scope, $timeout, $log, $ionicModal, $ionicHistory, configService, profileService, $state, addressService, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) { var wallet = profileService.getWallet($stateParams.walletId); var rawTx; @@ -102,6 +102,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', } else { var type = walletService.getViewStatus(wallet, txp); $scope.openStatusModal(type, txp, function() { + $ionicHistory.clearHistory(); $state.go('tabs.home'); }); } diff --git a/src/js/controllers/paymentUri.js b/src/js/controllers/paymentUri.js index 79628814c..70cf15d51 100644 --- a/src/js/controllers/paymentUri.js +++ b/src/js/controllers/paymentUri.js @@ -1,6 +1,6 @@ 'use strict'; angular.module('copayApp.controllers').controller('paymentUriController', - function($rootScope, $scope, $stateParams, $location, $timeout, profileService, configService, lodash, bitcore, $state) { + function($rootScope, $scope, $stateParams, $location, $timeout, $ionicHistory, profileService, configService, lodash, bitcore, $state) { function strip(number) { return (parseFloat(number.toPrecision(12))); }; @@ -47,6 +47,7 @@ angular.module('copayApp.controllers').controller('paymentUriController', this.selectWallet = function(wid) { var self = this; profileService.setAndStoreFocus(wid, function() {}); + $ionicHistory.clearHistory(); $state.go('tabs.home'); $timeout(function() { $rootScope.$emit('paymentUri', self.bitcoinURI); diff --git a/src/js/controllers/preferencesDelete.js b/src/js/controllers/preferencesDelete.js index c66e2c165..19cdccb1e 100644 --- a/src/js/controllers/preferencesDelete.js +++ b/src/js/controllers/preferencesDelete.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesDeleteWalletController', - function($scope, $ionicPopup, $stateParams, $ionicNavBarDelegate, gettextCatalog, lodash, profileService, $state, ongoingProcess, popupService) { + function($scope, $ionicPopup, $stateParams, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, lodash, profileService, $state, ongoingProcess, popupService) { $ionicNavBarDelegate.title(gettextCatalog.getString('Delete Wallet')); var wallet = profileService.getWallet($stateParams.walletId); $scope.alias = lodash.isEqual(wallet.name, wallet.credentials.walletName) ? null : wallet.name + ' '; @@ -37,6 +37,7 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro if (err) { popupService.showAlert(gettextCatalog.getString('Error'), err.message || err); } else { + $ionicHistory.clearHistory(); $state.go('tabs.home'); } }); diff --git a/src/js/controllers/preferencesHistory.js b/src/js/controllers/preferencesHistory.js index 721f3723e..2d478ae04 100644 --- a/src/js/controllers/preferencesHistory.js +++ b/src/js/controllers/preferencesHistory.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesHistory', - function($scope, $log, $stateParams, $timeout, $ionicNavBarDelegate, gettextCatalog, storageService, $state, profileService, lodash) { + function($scope, $log, $stateParams, $timeout, $ionicNavBarDelegate, gettextCatalog, storageService, $state, $ionicHistory, profileService, lodash) { $ionicNavBarDelegate.title(gettextCatalog.getString('Transaction History')); var wallet = profileService.getWallet($stateParams.walletId); var c = wallet.credentials; @@ -126,6 +126,7 @@ angular.module('copayApp.controllers').controller('preferencesHistory', $scope.$emit('Local/ClearHistory'); $timeout(function() { + $ionicHistory.clearHistory(); $state.go('tabs.home'); }, 100); }); diff --git a/src/js/controllers/preferencesInformation.js b/src/js/controllers/preferencesInformation.js index 2848d95ce..fd8d9f99c 100644 --- a/src/js/controllers/preferencesInformation.js +++ b/src/js/controllers/preferencesInformation.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesInformation', - function($scope, $log, $timeout, $ionicNavBarDelegate, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) { + function($scope, $log, $timeout, $ionicNavBarDelegate, $ionicHistory, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) { $ionicNavBarDelegate.title(gettextCatalog.getString('Wallet Information')); var base = 'xpub'; var wallet = profileService.getWallet($stateParams.walletId); @@ -105,6 +105,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation', opts.colorFor[walletId] = color; configService.set(opts, function(err) { + $ionicHistory.clearHistory(); $state.go('tabs.home'); if (err) $log.warn(err); }); @@ -116,6 +117,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation', $scope.scan = function() { walletService.startScan(wallet); + $ionicHistory.clearHistory(); $state.go('tabs.home'); }; diff --git a/src/js/services/applicationService.js b/src/js/services/applicationService.js index b5e80e4ea..6c7de2954 100644 --- a/src/js/services/applicationService.js +++ b/src/js/services/applicationService.js @@ -1,6 +1,6 @@ 'use strict'; angular.module('copayApp.services') - .factory('applicationService', function($rootScope, $timeout, platformInfo, $state) { + .factory('applicationService', function($rootScope, $timeout, $ionicHistory, platformInfo, $state) { var root = {}; var isChromeApp = platformInfo.isChromeApp; @@ -19,6 +19,7 @@ angular.module('copayApp.services') if (isChromeApp) { chrome.runtime.reload(); } else if (isNW) { + $ionicHistory.clearHistory(); $state.go('tabs.home'); $timeout(function() { var win = require('nw.gui').Window.get();