forked from matrix/element-web
prefer async/await
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
54a443b4f4
commit
40abf6f07b
|
@ -260,7 +260,8 @@ export async function loadApp() {
|
||||||
platform.startUpdater();
|
platform.startUpdater();
|
||||||
|
|
||||||
// Don't bother loading the app until the config is verified
|
// Don't bother loading the app until the config is verified
|
||||||
verifyServerConfig().then((newConfig) => {
|
try {
|
||||||
|
const newConfig = await verifyServerConfig();
|
||||||
const MatrixChat = sdk.getComponent('structures.MatrixChat');
|
const MatrixChat = sdk.getComponent('structures.MatrixChat');
|
||||||
window.matrixChat = ReactDOM.render(
|
window.matrixChat = ReactDOM.render(
|
||||||
<MatrixChat
|
<MatrixChat
|
||||||
|
@ -277,7 +278,7 @@ export async function loadApp() {
|
||||||
/>,
|
/>,
|
||||||
document.getElementById('matrixchat'),
|
document.getElementById('matrixchat'),
|
||||||
);
|
);
|
||||||
}).catch(err => {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
||||||
let errorMessage = err.translatedMessage
|
let errorMessage = err.translatedMessage
|
||||||
|
@ -290,7 +291,7 @@ export async function loadApp() {
|
||||||
<GenericErrorPage message={errorMessage} title={_t("Your Riot is misconfigured")} />,
|
<GenericErrorPage message={errorMessage} title={_t("Your Riot is misconfigured")} />,
|
||||||
document.getElementById('matrixchat'),
|
document.getElementById('matrixchat'),
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error("Browser is missing required features.");
|
console.error("Browser is missing required features.");
|
||||||
// take to a different landing page to AWOOOOOGA at the user
|
// take to a different landing page to AWOOOOOGA at the user
|
||||||
|
|
Loading…
Reference in New Issue