move push notifications config to configService

This commit is contained in:
Javier 2016-01-13 10:12:10 -03:00 committed by Gabriel Bazán
commit 50ffb0af23
3 changed files with 25 additions and 23 deletions

View file

@ -36,12 +36,12 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController',
var unwatchNotification = $scope.$watch('notifications', function(newVal, oldVal) {
if (newVal == oldVal) return;
var opts = {
notifications: {
pushNotifications: {
enabled: newVal
}
};
configService.set(opts, function(err) {
if (opts.notifications.enabled)
if (opts.pushNotifications.enabled)
pushNotificationsService.enableNotifications();
else
pushNotificationsService.disableNotifications();