mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #3365 from javierbitpay/fix/delete-txs-history
add delete history button in advanced->wallet info
This commit is contained in:
commit
5e877735c7
|
@ -96,7 +96,6 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<ul class="no-bullet m0 size-14" ng-show="index.balanceByAddress">
|
<ul class="no-bullet m0 size-14" ng-show="index.balanceByAddress">
|
||||||
<div ng-if="index.balanceByAddress[0]">
|
<div ng-if="index.balanceByAddress[0]">
|
||||||
<h4 class="title m0" translate>Balance By Address</h4>
|
<h4 class="title m0" translate>Balance By Address</h4>
|
||||||
|
@ -111,6 +110,15 @@
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<ul class="no-bullet m0 size-14">
|
||||||
|
<h4 class="title m0" translate>Transaction history</h4>
|
||||||
|
<li class="line-b p20 oh">
|
||||||
|
<button class="black round small expand" ng-style="{'background-color':index.backgroundColor}" ng-click="info.clearTransactionHistory();">
|
||||||
|
<span translate>Clear history</span>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h4></h4>
|
<h4></h4>
|
||||||
|
|
||||||
<div class="extra-margin-bottom"></div>
|
<div class="extra-margin-bottom"></div>
|
||||||
|
|
|
@ -1007,6 +1007,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$rootScope.$on('Local/ClearHistory', function(event) {
|
||||||
|
$log.debug('The wallet transaction history has been deleted');
|
||||||
|
self.txHistory = [];
|
||||||
|
self.updateHistory();
|
||||||
|
});
|
||||||
|
|
||||||
// UX event handlers
|
// UX event handlers
|
||||||
$rootScope.$on('Local/ColorUpdated', function(event) {
|
$rootScope.$on('Local/ColorUpdated', function(event) {
|
||||||
self.updateColor();
|
self.updateColor();
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesInformation',
|
angular.module('copayApp.controllers').controller('preferencesInformation',
|
||||||
function($scope, $log, $timeout, isMobile, gettextCatalog, lodash, profileService) {
|
function($scope, $log, $timeout, isMobile, gettextCatalog, lodash, profileService, storageService, go) {
|
||||||
var base = 'xpub';
|
var base = 'xpub';
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
var c = fc.credentials;
|
||||||
|
|
||||||
this.init = function() {
|
this.init = function() {
|
||||||
var fc = profileService.focusedClient;
|
|
||||||
var c = fc.credentials;
|
|
||||||
var basePath = profileService.getUtils().getBaseAddressDerivationPath(c.derivationStrategy, c.network, 0);
|
var basePath = profileService.getUtils().getBaseAddressDerivationPath(c.derivationStrategy, c.network, 0);
|
||||||
|
|
||||||
$scope.walletName = c.walletName;
|
$scope.walletName = c.walletName;
|
||||||
|
@ -28,8 +28,8 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
var last10 = [],
|
var last10 = [],
|
||||||
i = 0,
|
i = 0,
|
||||||
e = addrs.pop();
|
e = addrs.pop();
|
||||||
while (i++ < 10 && e) {
|
while (i++ < 10 && e) {
|
||||||
e.path = base + e.path.substring(1);
|
e.path = base + e.path.substring(1);
|
||||||
last10.push(e);
|
last10.push(e);
|
||||||
|
@ -45,7 +45,6 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
||||||
|
|
||||||
this.sendAddrs = function() {
|
this.sendAddrs = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
var fc = profileService.focusedClient;
|
|
||||||
|
|
||||||
if (isMobile.Android() || isMobile.Windows()) {
|
if (isMobile.Android() || isMobile.Windows()) {
|
||||||
window.ignoreMobilePause = true;
|
window.ignoreMobilePause = true;
|
||||||
|
@ -94,4 +93,19 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.clearTransactionHistory = function() {
|
||||||
|
storageService.removeTxHistory(c.walletId, function(err) {
|
||||||
|
if (err) {
|
||||||
|
$log.error(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.$emit('Local/ClearHistory');
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
go.walletHome();
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue