forked from matrix/element-web
loadOlm earlier
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
ee5d39a001
commit
0b032d7434
|
@ -40,7 +40,7 @@ import SdkConfig from "matrix-react-sdk/src/SdkConfig";
|
||||||
import {setTheme} from "matrix-react-sdk/src/theme";
|
import {setTheme} from "matrix-react-sdk/src/theme";
|
||||||
|
|
||||||
import CallHandler from 'matrix-react-sdk/src/CallHandler';
|
import CallHandler from 'matrix-react-sdk/src/CallHandler';
|
||||||
import {loadConfig, preparePlatform, loadLanguage, loadOlm} from "./init";
|
import {loadConfig, preparePlatform, loadLanguage} from "./init";
|
||||||
|
|
||||||
let lastLocationHashSet = null;
|
let lastLocationHashSet = null;
|
||||||
|
|
||||||
|
@ -144,8 +144,6 @@ export async function loadApp(fragParams: {}, acceptBrowser: boolean) {
|
||||||
|
|
||||||
window.addEventListener('hashchange', onHashChange);
|
window.addEventListener('hashchange', onHashChange);
|
||||||
|
|
||||||
await loadOlm();
|
|
||||||
|
|
||||||
// set the platform for react sdk
|
// set the platform for react sdk
|
||||||
preparePlatform();
|
preparePlatform();
|
||||||
const platform = PlatformPeg.get();
|
const platform = PlatformPeg.get();
|
||||||
|
|
|
@ -81,13 +81,15 @@ function checkBrowserFeatures() {
|
||||||
// try in react but fallback to an `alert`
|
// try in react but fallback to an `alert`
|
||||||
async function start() {
|
async function start() {
|
||||||
// load init.ts async so that its code is not executed immediately and we can catch any exceptions
|
// load init.ts async so that its code is not executed immediately and we can catch any exceptions
|
||||||
const {rageshakePromise, loadSkin, loadApp} = await import(
|
const {rageshakePromise, loadOlm, loadSkin, loadApp} = await import(
|
||||||
/* webpackChunkName: "init" */
|
/* webpackChunkName: "init" */
|
||||||
/* webpackPreload: true */
|
/* webpackPreload: true */
|
||||||
"./init");
|
"./init");
|
||||||
|
|
||||||
await settled(rageshakePromise); // give rageshake a chance to load/fail
|
await settled(rageshakePromise); // give rageshake a chance to load/fail
|
||||||
|
|
||||||
|
const loadOlmPromise = loadOlm();
|
||||||
|
|
||||||
const fragparts = parseQsFromFragment(window.location);
|
const fragparts = parseQsFromFragment(window.location);
|
||||||
|
|
||||||
// don't try to redirect to the native apps if we're
|
// don't try to redirect to the native apps if we're
|
||||||
|
@ -114,9 +116,11 @@ async function start() {
|
||||||
acceptBrowser = Boolean(window.localStorage.getItem("mx_accepts_unsupported_browser"));
|
acceptBrowser = Boolean(window.localStorage.getItem("mx_accepts_unsupported_browser"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// await things starting successfully
|
||||||
|
await loadOlmPromise;
|
||||||
|
|
||||||
// Finally, load the app. All of the other react-sdk imports are in this file which causes the skinner to
|
// Finally, load the app. All of the other react-sdk imports are in this file which causes the skinner to
|
||||||
// run on the components. We use `require` here to make sure webpack doesn't optimize this into an async
|
// run on the components.
|
||||||
// import and thus running before the skin can load.
|
|
||||||
await loadApp(fragparts.params, acceptBrowser);
|
await loadApp(fragparts.params, acceptBrowser);
|
||||||
}
|
}
|
||||||
start();
|
start();
|
||||||
|
|
Loading…
Reference in New Issue