mirror of https://github.com/BTCPrivate/copay.git
fix delete tx history
This commit is contained in:
parent
bca128a7ff
commit
bbb3acdca1
|
@ -1,12 +1,14 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesHistory',
|
angular.module('copayApp.controllers').controller('preferencesHistory',
|
||||||
function($scope, $log, $stateParams, $timeout, $state, $ionicHistory, storageService, platformInfo, profileService, lodash, appConfigService) {
|
function($scope, $log, $stateParams, $timeout, $state, $ionicHistory, storageService, platformInfo, profileService, lodash, appConfigService, walletService) {
|
||||||
$scope.wallet = profileService.getWallet($stateParams.walletId);
|
$scope.wallet = profileService.getWallet($stateParams.walletId);
|
||||||
$scope.csvReady = false;
|
$scope.csvReady = false;
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
$scope.isCordova = platformInfo.isCordova;
|
||||||
$scope.appName = appConfigService.nameCase;
|
$scope.appName = appConfigService.nameCase;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO : move this to walletService.
|
||||||
$scope.csvHistory = function(cb) {
|
$scope.csvHistory = function(cb) {
|
||||||
var allTxs = [];
|
var allTxs = [];
|
||||||
|
|
||||||
|
@ -123,12 +125,17 @@ angular.module('copayApp.controllers').controller('preferencesHistory',
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.clearTransactionHistory = function() {
|
$scope.clearTransactionHistory = function() {
|
||||||
storageService.removeTxHistory($scope.wallet.id, function(err) {
|
$log.info('Removing Transaction history ' + $scope.wallet.id);
|
||||||
|
|
||||||
|
walletService.clearTxHistory($scope.wallet, function(err) {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
$log.error(err);
|
$log.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$log.info('Transaction history cleared for :' + $scope.wallet.id);
|
||||||
|
|
||||||
$ionicHistory.removeBackView();
|
$ionicHistory.removeBackView();
|
||||||
$state.go('tabs.home');
|
$state.go('tabs.home');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
|
|
@ -551,6 +551,21 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
root.clearTxHistory = function(wallet, cb) {
|
||||||
|
root.invalidateCache(wallet);
|
||||||
|
|
||||||
|
storageService.removeTxHistory(wallet.id, function(err) {
|
||||||
|
if (err) {
|
||||||
|
$log.error(err);
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
|
return cb();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
root.getTxHistory = function(wallet, opts, cb) {
|
root.getTxHistory = function(wallet, opts, cb) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue