prepare platform earlier

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-04-08 16:09:47 +01:00
parent 0b032d7434
commit 6222546e20
2 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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();