refactor preferences

This commit is contained in:
Matias Alejo Garcia 2016-06-06 18:26:45 -03:00
commit 1e2555dad9
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
15 changed files with 222 additions and 200 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesUnitController',
function($scope, $timeout, $log, configService, go) {
function($scope, $timeout, $log, configService, go, walletService, profileService) {
var config = configService.getSync();
this.unitName = config.wallet.settings.unitName;
this.unitOpts = [
@ -54,6 +54,9 @@ angular.module('copayApp.controllers').controller('preferencesUnitController',
if (err) $log.warn(err);
go.preferencesGlobal();
$scope.$emit('Local/UnitSettingUpdated');
walletService.updateRemotePreferences(profileService.getClients(), {}, function() {
$log.debug('Remote preferences saved')
});
$timeout(function() {
$scope.$apply();
}, 100);