Skip to content

Commit e267086

Browse files
committed
Parallelize loadSkin
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent b378044 commit e267086

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/vector/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ function checkBrowserFeatures() {
7676
return featureComplete;
7777
}
7878

79+
let acceptBrowser = checkBrowserFeatures();
80+
if (!acceptBrowser && window.localStorage) {
81+
acceptBrowser = Boolean(window.localStorage.getItem("mx_accepts_unsupported_browser"));
82+
}
83+
7984
// React depends on Map & Set which we check for using modernizr's es6collections
8085
// if modernizr fails we may not have a functional react to show the error message.
8186
// try in react but fallback to an `alert`
@@ -124,22 +129,17 @@ async function start() {
124129
// load config requires the platform to be ready
125130
const loadConfigPromise = loadConfig();
126131

127-
await loadSkin();
128-
129-
let acceptBrowser = checkBrowserFeatures();
130-
if (!acceptBrowser && window.localStorage) {
131-
acceptBrowser = Boolean(window.localStorage.getItem("mx_accepts_unsupported_browser"));
132-
}
133-
134132
// await config here
135133
const configError = await loadConfigPromise;
136134
// Load language after loading config.json so that settingsDefaults.language can be applied
137135
const loadLanguagePromise = loadLanguage();
138136
// as quickly as we possibly can, set a default theme...
139137
const loadThemePromise = loadTheme();
138+
const loadSkinPromise = loadSkin();
140139

141140
// await things starting successfully
142141
await loadOlmPromise;
142+
await settled(loadSkinPromise);
143143
await loadThemePromise;
144144
await loadLanguagePromise;
145145

0 commit comments

Comments
 (0)