New push notifications

This commit is contained in:
Gustavo Maximiliano Cortez 2017-02-03 18:03:29 -03:00
commit 4e8bd0634c
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
13 changed files with 139 additions and 153 deletions

View file

@ -9,7 +9,7 @@ angular.module('copayApp.controllers').controller('preferencesNotificationsContr
$scope.isIOSApp = platformInfo.isIOS && platformInfo.isCordova;
$scope.pushNotifications = {
value: config.pushNotifications.enabled
value: config.pushNotificationsEnabled
};
$scope.latestEmail = {
@ -31,16 +31,14 @@ angular.module('copayApp.controllers').controller('preferencesNotificationsContr
$scope.pushNotificationsChange = function() {
if (!$scope.pushNotifications) return;
var opts = {
pushNotifications: {
enabled: $scope.pushNotifications.value
}
pushNotificationsEnabled: $scope.pushNotifications.value
};
configService.set(opts, function(err) {
if (opts.pushNotifications.enabled)
profileService.pushNotificationsInit();
else
pushNotificationsService.disableNotifications(profileService.getWallets());
if (err) $log.debug(err);
if (opts.pushNotificationsEnabled)
pushNotificationsService.init();
else
pushNotificationsService.disable();
});
};