refactor
This commit is contained in:
parent
2d07cf0e55
commit
171665afe6
4 changed files with 93 additions and 93 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesGlobalController',
|
||||
function($scope, $rootScope, $log, configService, uxLanguage, isCordova) {
|
||||
function($scope, $rootScope, $log, configService, uxLanguage, isCordova, pushNotificationsService) {
|
||||
|
||||
this.init = function() {
|
||||
var config = configService.getSync();
|
||||
|
|
@ -41,7 +41,10 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController',
|
|||
}
|
||||
};
|
||||
configService.set(opts, function(err) {
|
||||
$rootScope.$emit('Local/EnableNotifications', opts.notifications.enabled);
|
||||
if (opts.notifications.enabled)
|
||||
pushNotificationsService.enableNotifications();
|
||||
else
|
||||
pushNotificationsService.disableNotifications();
|
||||
if (err) $log.debug(err);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue