unsubscribe when wallet is deleted

This commit is contained in:
Gabriel Bazán 2016-01-04 16:35:34 -03:00
commit 2d64e61654
3 changed files with 19 additions and 7 deletions

View file

@ -326,6 +326,8 @@ angular.module('copayApp.services')
if (err) $log.warn(err);
});
$rootScope.$emit('Local/UnsubscribeNotifications', walletId);
$timeout(function() {
root.setWalletClients();
root.setAndStoreFocus(null, function() {
@ -397,7 +399,7 @@ angular.module('copayApp.services')
handleImport(function() {
root.setAndStoreFocus(walletId, function() {
storageService.storeProfile(root.profile, function(err) {
$rootScope.$emit('Local/EnableNotifications');
$rootScope.$emit('Local/SubscribeNotifications');
return cb(err, walletId);
});
});