Merge pull request #5386 from antonio-fr/master

Fix wallet deletion without push
This commit is contained in:
Javier Donadío 2017-01-06 17:48:30 -03:00 committed by GitHub
commit 611654e25e
1 changed files with 6 additions and 4 deletions

View File

@ -480,10 +480,12 @@ angular.module('copayApp.services')
root.deleteWalletClient = function(client, cb) { root.deleteWalletClient = function(client, cb) {
var walletId = client.credentials.walletId; var walletId = client.credentials.walletId;
pushNotificationsService.unsubscribe(root.getWallet(walletId), function(err) { var config = configService.getSync();
if (err) $log.warn('Unsubscription error: ' + err.message); if (config.pushNotifications.enabled)
else $log.debug('Unsubscribed from push notifications service'); pushNotificationsService.unsubscribe(root.getWallet(walletId), function(err) {
}); if (err) $log.warn('Unsubscription error: ' + err.message);
else $log.debug('Unsubscribed from push notifications service');
});
$log.debug('Deleting Wallet:', client.credentials.walletName); $log.debug('Deleting Wallet:', client.credentials.walletName);
client.removeAllListeners(); client.removeAllListeners();