refactor preferences
This commit is contained in:
parent
4865ea8ad8
commit
1e2555dad9
15 changed files with 222 additions and 200 deletions
|
|
@ -3,6 +3,8 @@ angular.module('copayApp.services')
|
|||
.factory('uxLanguage', function languageService($log, lodash, gettextCatalog, amMoment, configService) {
|
||||
var root = {};
|
||||
|
||||
root.currentLanguage = null;
|
||||
|
||||
root.availableLanguages = [{
|
||||
name: 'English',
|
||||
isoCode: 'en',
|
||||
|
|
@ -33,7 +35,6 @@ angular.module('copayApp.services')
|
|||
isoCode: 'ru',
|
||||
}];
|
||||
|
||||
root.currentLanguage = null;
|
||||
|
||||
root._detect = function(cb) {
|
||||
|
||||
|
|
@ -99,20 +100,20 @@ angular.module('copayApp.services')
|
|||
var userLang = configService.getSync().wallet.settings.defaultLanguage;
|
||||
|
||||
if (!userLang) {
|
||||
|
||||
root._detect(function(lang) {
|
||||
userLang = lang;
|
||||
|
||||
if (userLang != root.currentLanguage) {
|
||||
root._set(lang);
|
||||
}
|
||||
return cb(userLang);
|
||||
if (cb) return cb(userLang);
|
||||
});
|
||||
} else {
|
||||
if (userLang != root.currentLanguage) {
|
||||
root._set(userLang);
|
||||
}
|
||||
return cb(userLang);
|
||||
|
||||
if (cb) return cb(userLang);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue