deleting wallet with callback
This commit is contained in:
parent
ea7de935d7
commit
74b61624e5
4 changed files with 19 additions and 10 deletions
|
|
@ -88,7 +88,13 @@ angular.module('copayApp.controllers').controller('MoreController',
|
|||
};
|
||||
|
||||
$scope.deleteWallet = function() {
|
||||
controllerUtils.deleteWallet($scope);
|
||||
$scope.loading = true;
|
||||
controllerUtils.deleteWallet($scope, $rootScope.wallet, function() {
|
||||
$rootScope.wallet = null;
|
||||
var lastFocused = $rootScope.iden.getLastFocusedWallet();
|
||||
controllerUtils.bindProfile($scope, $rootScope.iden, lastFocused);
|
||||
$scope.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.purge = function(deleteAll) {
|
||||
|
|
|
|||
|
|
@ -359,15 +359,12 @@ angular.module('copayApp.services')
|
|||
$rootScope.pendingTxCount = res.pendingForUs;
|
||||
};
|
||||
|
||||
root.deleteWallet = function($scope, w, skipBind) {
|
||||
w = w || $rootScope.wallet;
|
||||
root.deleteWallet = function($scope, w, cb) {
|
||||
if (!w) return root.onErrorDigest();
|
||||
var name = w.getName();
|
||||
$rootScope.iden.deleteWallet(w.id, function() {
|
||||
notification.info(name + ' deleted', $filter('translate')('Wallet deleted'));
|
||||
if (skipBind) return skipBind();
|
||||
$rootScope.wallet = null;
|
||||
var lastFocused = $rootScope.iden.getLastFocusedWallet();
|
||||
root.bindProfile($scope, $rootScope.iden, lastFocused);
|
||||
notification.info(name + ' deleted', $filter('translate')('This wallet was deleted'));
|
||||
return cb();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
<td width="70" class="text-center">
|
||||
<a translate
|
||||
class="warning"
|
||||
ng-really-message="{{'Are you sure to delete the wallet'}} {{(item.name || item.id)}}"
|
||||
ng-really-message="{{'Are you sure you want to delete the wallet'}} {{(item.name || item.id)}}"
|
||||
ng-really-click="deleteWallet(item)"
|
||||
ng-show="activeWallet != item.id && loading != item.id">Delete</a>
|
||||
<span ng-show="loading == item.id"><i class="fi-bitcoin-circle icon-rotate spinner"></i></span>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,13 @@
|
|||
<div class="panel">
|
||||
<h2><i class="fi-minus-circle m10r"></i> <span translate>Delete Wallet</span></h2>
|
||||
<p translate class="text-gray">If all funds have been removed from your wallet and you do not wish to have the wallet data stored on your computer anymore, you can delete your wallet.</p>
|
||||
<a translate class="button warning m0" ng-really-message="{{'Are you sure to delete this wallet from this computer?'|translate}}" ng-really-click="deleteWallet()"> Delete</a>
|
||||
<a class="button warning m0"
|
||||
ng-really-message="{{'Are you sure you want to delete this wallet?'|translate}}"
|
||||
ng-really-click="deleteWallet()"
|
||||
ng-class="{'disabled':loading}">
|
||||
<span ng-show="!loading">Delete</span>
|
||||
<span ng-show="loading">Deleting...</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue