From 6222546e20698f882f46d95bf05d7a8d3e73a8da Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 8 Apr 2020 16:09:47 +0100 Subject: [PATCH] prepare platform earlier Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/app.js | 2 -- src/vector/index.ts | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/vector/app.js b/src/vector/app.js index dee663a16b..327690e647 100644 --- a/src/vector/app.js +++ b/src/vector/app.js @@ -144,8 +144,6 @@ export async function loadApp(fragParams: {}, acceptBrowser: boolean) { window.addEventListener('hashchange', onHashChange); - // set the platform for react sdk - preparePlatform(); const platform = PlatformPeg.get(); // Load the config from the platform diff --git a/src/vector/index.ts b/src/vector/index.ts index a35f40c70d..737aeed8ab 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -21,6 +21,8 @@ limitations under the License. // Require common CSS here; this will make webpack process it into bundle.css. // Our own CSS (which is themed) is imported via separate webpack entry points // in webpack.config.js +import {preparePlatform} from "./init"; + require('gfm.css/gfm.css'); require('highlight.js/styles/github.css'); @@ -81,7 +83,7 @@ function checkBrowserFeatures() { // try in react but fallback to an `alert` async function start() { // load init.ts async so that its code is not executed immediately and we can catch any exceptions - const {rageshakePromise, loadOlm, loadSkin, loadApp} = await import( + const {rageshakePromise, preparePlatform, loadOlm, loadSkin, loadApp} = await import( /* webpackChunkName: "init" */ /* webpackPreload: true */ "./init"); @@ -109,6 +111,9 @@ async function start() { } } + // set the platform for react sdk + preparePlatform(); + await loadSkin(); let acceptBrowser = checkBrowserFeatures();