move configError check earlier, as SdkConfig will cause Exception

if it has undefined pass to it

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-06-06 13:09:31 +01:00
parent ab09d4b632
commit 026a072278
No known key found for this signature in database
GPG key ID: 3F879DA5AD802A5E

View file

@ -264,6 +264,13 @@ async function loadApp() {
const configJson = await loadConfig();
if (!configJson) {
window.matrixChat = ReactDOM.render(<div className="error">
Unable to load config file: please refresh the page to try again.
</div>, document.getElementById('matrixchat'));
return;
}
// XXX: We call this twice, once here and once in MatrixChat as a prop. We call it here to ensure
// granular settings are loaded correctly and to avoid duplicating the override logic for the theme.
SdkConfig.put(configJson);
@ -343,11 +350,7 @@ async function loadApp() {
}
console.log("Vector starting at "+window.location);
if (!configJson) {
window.matrixChat = ReactDOM.render(<div className="error">
Unable to load config file: please refresh the page to try again.
</div>, document.getElementById('matrixchat'));
} else if (validBrowser) {
if (validBrowser) {
const platform = PlatformPeg.get();
platform.startUpdater();