Merge pull request #3408 from cmgustavo/ref/delete-wallet-01
Ref delete wallet
This commit is contained in:
commit
b28ecaad6d
3 changed files with 22 additions and 8 deletions
|
|
@ -53,12 +53,9 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
|
|||
if (err) {
|
||||
self.error = err.message || err;
|
||||
} else {
|
||||
storageService.removeTxHistory(fc.credentials.walletId, function() {
|
||||
notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {
|
||||
walletName: walletName
|
||||
}));
|
||||
return;
|
||||
});
|
||||
notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {
|
||||
walletName: walletName
|
||||
}));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -303,16 +303,29 @@ angular.module('copayApp.services')
|
|||
|
||||
root.deleteWalletFC = function(opts, cb) {
|
||||
var fc = root.focusedClient;
|
||||
var walletId = fc.credentials.walletId;
|
||||
$log.debug('Deleting Wallet:', fc.credentials.walletName);
|
||||
|
||||
fc.removeAllListeners();
|
||||
root.profile.credentials = lodash.reject(root.profile.credentials, {
|
||||
walletId: fc.credentials.walletId
|
||||
walletId: walletId
|
||||
});
|
||||
|
||||
delete root.walletClients[fc.credentials.walletId];
|
||||
delete root.walletClients[walletId];
|
||||
root.focusedClient = null;
|
||||
|
||||
storageService.clearLastAddress(walletId, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
});
|
||||
|
||||
storageService.removeTxHistory(walletId, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
});
|
||||
|
||||
storageService.clearBackupFlag(walletId, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
});
|
||||
|
||||
$timeout(function() {
|
||||
root.setWalletClients();
|
||||
root.setAndStoreFocus(null, function() {
|
||||
|
|
|
|||
|
|
@ -159,6 +159,10 @@ angular.module('copayApp.services')
|
|||
storage.get('backup-' + walletId, cb);
|
||||
};
|
||||
|
||||
root.clearBackupFlag = function(walletId, cb) {
|
||||
storage.remove('backup-' + walletId, cb);
|
||||
};
|
||||
|
||||
root.setCleanAndScanAddresses = function(walletId, cb) {
|
||||
storage.set('CleanAndScanAddresses', walletId, cb);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue