From 241d95293e1dcd1452dc4c07a314bfa609ae205c Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 23 May 2017 16:44:54 +0100 Subject: [PATCH] Code style fixes Use async/await consistently rather than flipping between that and callbacks, s/var/let/, indenting --- src/vector/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index f1af7ebc..62595c22 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -247,6 +247,7 @@ function onLoadCompleted() { } async function loadApp() { + await loadLanguage(); const fragparts = parseQsFromFragment(window.location); const params = parseQs(window.location); @@ -338,17 +339,16 @@ async function loadApp() { } } -function loadLanguage(callback) { +async function loadLanguage() { const _localSettings = getLocalSettings(); - var languages = []; + let languages = []; if (!_localSettings.hasOwnProperty('language')) { languages = languageHandler.getNormalizedLanguageKeys(languageHandler.getLanguageFromBrowser()); - }else { - languages = languageHandler.getNormalizedLanguageKeys(_localSettings.language); + } else { + languages = languageHandler.getNormalizedLanguageKeys(_localSettings.language); } languageHandler.setLanguage(languages, counterpart); setLocalSetting('language', languages[0]); - callback(); } -loadLanguage(loadApp); +loadApp();