delete token arg in unsusbscribe methods
This commit is contained in:
parent
070669d835
commit
1a8cd4e59e
2 changed files with 10 additions and 14 deletions
|
|
@ -1289,12 +1289,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
});
|
});
|
||||||
|
|
||||||
$rootScope.$on('Local/UnsubscribeNotifications', function(event, walletId, cb) {
|
$rootScope.$on('Local/UnsubscribeNotifications', function(event, walletId, cb) {
|
||||||
storageService.getDeviceToken(function(err, token) {
|
pushNotificationsService.unsubscribe(walletId, function(err, response) {
|
||||||
pushNotificationsService.unsubscribe(token, walletId, function(err, response) {
|
if (err) $log.warn('Error: ' + err.code);
|
||||||
if (err) $log.warn('Error: ' + err.code);
|
$log.debug('Unsubscribed: ' + response);
|
||||||
$log.debug('Unsubscribed: ' + response);
|
return cb();
|
||||||
return cb();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,10 @@ angular.module('copayApp.services')
|
||||||
}
|
}
|
||||||
|
|
||||||
root.disableNotifications = function() {
|
root.disableNotifications = function() {
|
||||||
storageService.getDeviceToken(function(err, token) {
|
lodash.forEach(profileService.getWallets('testnet'), function(wallet) {
|
||||||
lodash.forEach(profileService.getWallets('testnet'), function(wallet) {
|
root.unsubscribe(wallet.id, function(err, response) {
|
||||||
root.unsubscribe(token, wallet.id, function(err, response) {
|
if (err) $log.warn('Error: ' + err.code);
|
||||||
if (err) $log.warn('Error: ' + err.code);
|
$log.debug('Unsubscribed: ' + response);
|
||||||
$log.debug('Unsubscribed: ' + response);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -63,9 +61,9 @@ angular.module('copayApp.services')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
root.unsubscribe = function(token, walletId, cb) {
|
root.unsubscribe = function(walletId, cb) {
|
||||||
var walletClient = profileService.getClient(walletId);
|
var walletClient = profileService.getClient(walletId);
|
||||||
walletClient.pushNotificationsUnsubscribe(token, function(err, resp) {
|
walletClient.pushNotificationsUnsubscribe(function(err, resp) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
return cb(null, resp);
|
return cb(null, resp);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue