unsubscribe method refactor
This commit is contained in:
parent
d8cfb9dd5c
commit
58b573ac4e
3 changed files with 42 additions and 35 deletions
|
|
@ -1288,10 +1288,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
pushNotificationsService.enableNotifications();
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/UnsubscribeNotifications', function(event) {
|
||||
pushNotificationsService.unsubscribe(null, function(err, response) {
|
||||
if (err) $log.warn('Error: ' + err.code);
|
||||
$log.debug('Unsubscribed: ' + response);
|
||||
$rootScope.$on('Local/UnsubscribeNotifications', function(event, walletId, cb) {
|
||||
storageService.getDeviceToken(function(err, token) {
|
||||
pushNotificationsService.unsubscribe(token, walletId, function(err, response) {
|
||||
if (err) $log.warn('Error: ' + err.code);
|
||||
$log.debug('Unsubscribed: ' + response);
|
||||
return cb();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue