From e267086a1733b344ab124a6511ce8de28ac0efba Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 8 Apr 2020 19:21:39 +0100 Subject: [PATCH] Parallelize loadSkin Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vector/index.ts b/src/vector/index.ts index cd33ab32..651b0191 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -76,6 +76,11 @@ function checkBrowserFeatures() { return featureComplete; } +let acceptBrowser = checkBrowserFeatures(); +if (!acceptBrowser && window.localStorage) { + acceptBrowser = Boolean(window.localStorage.getItem("mx_accepts_unsupported_browser")); +} + // React depends on Map & Set which we check for using modernizr's es6collections // if modernizr fails we may not have a functional react to show the error message. // try in react but fallback to an `alert` @@ -124,22 +129,17 @@ async function start() { // load config requires the platform to be ready const loadConfigPromise = loadConfig(); - await loadSkin(); - - let acceptBrowser = checkBrowserFeatures(); - if (!acceptBrowser && window.localStorage) { - acceptBrowser = Boolean(window.localStorage.getItem("mx_accepts_unsupported_browser")); - } - // await config here const configError = await loadConfigPromise; // Load language after loading config.json so that settingsDefaults.language can be applied const loadLanguagePromise = loadLanguage(); // as quickly as we possibly can, set a default theme... const loadThemePromise = loadTheme(); + const loadSkinPromise = loadSkin(); // await things starting successfully await loadOlmPromise; + await settled(loadSkinPromise); await loadThemePromise; await loadLanguagePromise;