mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Code style fixes
Use async/await consistently rather than flipping between that and callbacks, s/var/let/, indenting
This commit is contained in:
parent
a6b11968a4
commit
241d95293e
@ -247,6 +247,7 @@ function onLoadCompleted() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function loadApp() {
|
async function loadApp() {
|
||||||
|
await loadLanguage();
|
||||||
|
|
||||||
const fragparts = parseQsFromFragment(window.location);
|
const fragparts = parseQsFromFragment(window.location);
|
||||||
const params = parseQs(window.location);
|
const params = parseQs(window.location);
|
||||||
@ -338,9 +339,9 @@ async function loadApp() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadLanguage(callback) {
|
async function loadLanguage() {
|
||||||
const _localSettings = getLocalSettings();
|
const _localSettings = getLocalSettings();
|
||||||
var languages = [];
|
let languages = [];
|
||||||
if (!_localSettings.hasOwnProperty('language')) {
|
if (!_localSettings.hasOwnProperty('language')) {
|
||||||
languages = languageHandler.getNormalizedLanguageKeys(languageHandler.getLanguageFromBrowser());
|
languages = languageHandler.getNormalizedLanguageKeys(languageHandler.getLanguageFromBrowser());
|
||||||
} else {
|
} else {
|
||||||
@ -348,7 +349,6 @@ function loadLanguage(callback) {
|
|||||||
}
|
}
|
||||||
languageHandler.setLanguage(languages, counterpart);
|
languageHandler.setLanguage(languages, counterpart);
|
||||||
setLocalSetting('language', languages[0]);
|
setLocalSetting('language', languages[0]);
|
||||||
callback();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadLanguage(loadApp);
|
loadApp();
|
||||||
|
Loading…
Reference in New Issue
Block a user