delete token arg in unsusbscribe methods

This commit is contained in:
Gabriel Bazán 2016-01-18 17:42:31 -03:00
commit 1a8cd4e59e
2 changed files with 10 additions and 14 deletions

View file

@ -1289,14 +1289,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
$rootScope.$on('Local/UnsubscribeNotifications', function(event, walletId, cb) {
storageService.getDeviceToken(function(err, token) {
pushNotificationsService.unsubscribe(token, walletId, function(err, response) {
pushNotificationsService.unsubscribe(walletId, function(err, response) {
if (err) $log.warn('Error: ' + err.code);
$log.debug('Unsubscribed: ' + response);
return cb();
});
});
});
self.debouncedUpdate = lodash.throttle(function() {
self.updateAll({

View file

@ -45,14 +45,12 @@ angular.module('copayApp.services')
}
root.disableNotifications = function() {
storageService.getDeviceToken(function(err, token) {
lodash.forEach(profileService.getWallets('testnet'), function(wallet) {
root.unsubscribe(token, wallet.id, function(err, response) {
root.unsubscribe(wallet.id, function(err, response) {
if (err) $log.warn('Error: ' + err.code);
$log.debug('Unsubscribed: ' + response);
});
});
});
}
root.subscribe = function(opts, walletId, cb) {
@ -63,9 +61,9 @@ angular.module('copayApp.services')
});
}
root.unsubscribe = function(token, walletId, cb) {
root.unsubscribe = function(walletId, cb) {
var walletClient = profileService.getClient(walletId);
walletClient.pushNotificationsUnsubscribe(token, function(err, resp) {
walletClient.pushNotificationsUnsubscribe(function(err, resp) {
if (err) return cb(err);
return cb(null, resp);
});