save lang and unit in BWS
This commit is contained in:
parent
c6e4773f9d
commit
c65b2d7c07
6 changed files with 140 additions and 74 deletions
|
|
@ -1,12 +1,24 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesLanguageController',
|
||||
function($scope, $timeout, go) {
|
||||
function($scope, $log, $timeout, configService, go) {
|
||||
|
||||
this.save = function(newLang) {
|
||||
$scope.$emit('Local/DefaultLanguage', newLang);
|
||||
$timeout(function() {
|
||||
go.preferences();
|
||||
}, 100);
|
||||
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
defaultLanguage: newLang
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
$scope.$emit('Local/LanguageSettingUpdated');
|
||||
$timeout(function() {
|
||||
go.preferences();
|
||||
}, 100);
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue