From c11432c3e3b48dbe68e596351653f42f6ee4490c Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Aug 2017 19:35:33 +0100 Subject: [PATCH] Catch the promise rejection if scalar fails Otherwise this is incredibly annoying when developing if you don't have a scalar that will allow you to register (ie. if you're testing against an HS on your dev box) --- src/components/views/rooms/AppsDrawer.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index 824a719245..536259ae91 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -53,14 +53,14 @@ module.exports = React.createClass({ this.scalarClient = null; if (SdkConfig.get().integrations_ui_url && SdkConfig.get().integrations_rest_url) { this.scalarClient = new ScalarAuthClient(); - this.scalarClient.connect().done(() => { + this.scalarClient.connect().then(() => { this.forceUpdate(); - // TODO -- Handle Scalar errors - // }, - // (err) => { - // this.setState({ - // scalar_error: err, - // }); + }).catch((e) => { + console.log("Failed to connect to integrations server"); + // TODO -- Handle Scalar errors + // this.setState({ + // scalar_error: err, + // }); }); }