File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ function onTokenLoginCompleted() {
128128 window . location . href = formatted ;
129129}
130130
131- export async function loadApp ( fragParams : { } , acceptBrowser : boolean ) {
131+ export async function loadApp ( fragParams : { } , acceptBrowser : boolean , configError : Error ) {
132132 // XXX: the way we pass the path to the worker script from webpack via html in body's dataset is a hack
133133 // but alternatives seem to require changing the interface to passing Workers to js-sdk
134134 const vectorIndexeddbWorkerScript = document . body . dataset . vectorIndexeddbWorkerScript ;
@@ -146,9 +146,6 @@ export async function loadApp(fragParams: {}, acceptBrowser: boolean) {
146146
147147 const platform = PlatformPeg . get ( ) ;
148148
149- // Load the config from the platform
150- const configError = await loadConfig ( ) ;
151-
152149 // Load language after loading config.json so that settingsDefaults.language can be applied
153150 await loadLanguage ( ) ;
154151
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ limitations under the License.
2121// Require common CSS here; this will make webpack process it into bundle.css.
2222// Our own CSS (which is themed) is imported via separate webpack entry points
2323// in webpack.config.js
24- import { preparePlatform } from "./init" ;
24+ import { loadConfig , preparePlatform } from "./init" ;
2525
2626require ( 'gfm.css/gfm.css' ) ;
2727require ( 'highlight.js/styles/github.css' ) ;
@@ -112,7 +112,8 @@ async function start() {
112112
113113 // set the platform for react sdk
114114 preparePlatform ( ) ;
115-
115+ // load config requires the platform to be ready
116+ const loadConfigPromise = loadConfig ( ) ;
116117 const loadOlmPromise = loadOlm ( ) ;
117118
118119 await loadSkin ( ) ;
@@ -125,8 +126,11 @@ async function start() {
125126 // await things starting successfully
126127 await loadOlmPromise ;
127128
129+
130+ const configError = await loadConfigPromise ;
131+
128132 // Finally, load the app. All of the other react-sdk imports are in this file which causes the skinner to
129133 // run on the components.
130- await loadApp ( fragparts . params , acceptBrowser ) ;
134+ await loadApp ( fragparts . params , acceptBrowser , configError ) ;
131135}
132136start ( ) ;
Original file line number Diff line number Diff line change @@ -138,12 +138,12 @@ export async function loadSkin() {
138138 console . log ( "Skin loaded!" ) ;
139139}
140140
141- export async function loadApp ( fragParams : { } , acceptBrowser : boolean ) {
141+ export async function loadApp ( fragParams : { } , acceptBrowser : boolean , configError : Error ) {
142142 // load app.js async so that its code is not executed immediately and we can catch any exceptions
143143 const module = await import (
144144 /* webpackChunkName: "riot-web-app" */
145145 /* webpackPreload: true */
146146 "./app" ) ;
147- window . matrixChat = ReactDOM . render ( await module . loadApp ( fragParams , acceptBrowser ) ,
147+ window . matrixChat = ReactDOM . render ( await module . loadApp ( fragParams , acceptBrowser , configError ) ,
148148 document . getElementById ( 'matrixchat' ) ) ;
149149}
You can’t perform that action at this time.
0 commit comments