refactor preferences
This commit is contained in:
parent
4865ea8ad8
commit
1e2555dad9
15 changed files with 222 additions and 200 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesLanguageController',
|
||||
function($scope, $log, $timeout, configService, uxLanguage, go) {
|
||||
function($scope, $log, $timeout, configService, profileService, uxLanguage, walletService, go) {
|
||||
|
||||
this.availableLanguages = uxLanguage.getLanguages();
|
||||
this.currentLanguage = uxLanguage.getCurrentLanguage();
|
||||
|
|
@ -19,10 +19,18 @@ angular.module('copayApp.controllers').controller('preferencesLanguageController
|
|||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
go.preferencesGlobal();
|
||||
$scope.$emit('Local/LanguageSettingUpdated');
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 100);
|
||||
|
||||
|
||||
uxLanguage.update(function() {
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 100);
|
||||
|
||||
walletService.updateRemotePreferences(profileService.getClients(), {},
|
||||
function() {
|
||||
$log.debug('Remote preferences saved')
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue