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';
|
||||
|
||||
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.csvReady = false;
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
$scope.appName = appConfigService.nameCase;
|
||||
|
||||
|
||||
// TODO : move this to walletService.
|
||||
$scope.csvHistory = function(cb) {
|
||||
var allTxs = [];
|
||||
|
||||
|
@ -123,12 +125,17 @@ angular.module('copayApp.controllers').controller('preferencesHistory',
|
|||
};
|
||||
|
||||
$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) {
|
||||
$log.error(err);
|
||||
return;
|
||||
}
|
||||
|
||||
$log.info('Transaction history cleared for :' + $scope.wallet.id);
|
||||
|
||||
$ionicHistory.removeBackView();
|
||||
$state.go('tabs.home');
|
||||
$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) {
|
||||
opts = opts || {};
|
||||
|
||||
|
|
Loading…
Reference in New Issue