replace timeout for whenAvailable function

This commit is contained in:
Javier 2016-09-05 11:33:41 -03:00
parent 50c30c25ec
commit 55ae03613f
1 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.services') angular.module('copayApp.services')
.factory('uxLanguage', function languageService($log, $timeout, lodash, gettextCatalog, amMoment, configService) { .factory('uxLanguage', function languageService($log, lodash, gettextCatalog, amMoment, configService) {
var root = {}; var root = {};
root.currentLanguage = null; root.currentLanguage = null;
@ -97,8 +97,8 @@ angular.module('copayApp.services')
}; };
root.init = function() { root.init = function() {
$timeout(function() { configService.whenAvailable(function(config) {
var userLang = configService.getSync().wallet.settings.defaultLanguage; var userLang = config.wallet.settings.defaultLanguage;
if (userLang && userLang != root.currentLanguage) { if (userLang && userLang != root.currentLanguage) {
root._set(userLang); root._set(userLang);
@ -108,7 +108,7 @@ angular.module('copayApp.services')
root._detect(function(lang) { root._detect(function(lang) {
root._set(lang); root._set(lang);
}); });
}, 100); });
}; };
root.update = function(cb) { root.update = function(cb) {