From 40abf6f07b407067526e93b384f0ce914c9aed25 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Sat, 28 Mar 2020 11:37:13 +0000
Subject: [PATCH] prefer async/await
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/vector/app.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/vector/app.js b/src/vector/app.js
index e52cf4f7..9e989b1a 100644
--- a/src/vector/app.js
+++ b/src/vector/app.js
@@ -260,7 +260,8 @@ export async function loadApp() {
platform.startUpdater();
// 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');
window.matrixChat = ReactDOM.render(
,
document.getElementById('matrixchat'),
);
- }).catch(err => {
+ } catch (err) {
console.error(err);
let errorMessage = err.translatedMessage
@@ -290,7 +291,7 @@ export async function loadApp() {
,
document.getElementById('matrixchat'),
);
- });
+ }
} else {
console.error("Browser is missing required features.");
// take to a different landing page to AWOOOOOGA at the user