Fix wallet deletion without push
Fix a BWS crash when deleting a wallet with push disabled. No need of push unsubscribe when push is disabled. Else this leads to a full crash and stop of BWS server incase it doesn't support push.
This commit is contained in:
parent
2cd24a8baf
commit
d1ea109257
1 changed files with 6 additions and 4 deletions
|
|
@ -480,10 +480,12 @@ angular.module('copayApp.services')
|
|||
root.deleteWalletClient = function(client, cb) {
|
||||
var walletId = client.credentials.walletId;
|
||||
|
||||
pushNotificationsService.unsubscribe(root.getWallet(walletId), function(err) {
|
||||
if (err) $log.warn('Unsubscription error: ' + err.message);
|
||||
else $log.debug('Unsubscribed from push notifications service');
|
||||
});
|
||||
var config = configService.getSync();
|
||||
if (config.pushNotifications.enabled)
|
||||
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);
|
||||
client.removeAllListeners();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue