mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-09 16:23:14 +00:00
Consistent async / await / promises.
This commit is contained in:
@@ -25,13 +25,13 @@ if (!global.mxIntegrationManager) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class IntegrationManager {
|
export default class IntegrationManager {
|
||||||
static async _init() {
|
static _init() {
|
||||||
if (!global.mxIntegrationManager.client || !global.mxIntegrationManager.connected) {
|
if (!global.mxIntegrationManager.client || !global.mxIntegrationManager.connected) {
|
||||||
if (SdkConfig.get().integrations_ui_url && SdkConfig.get().integrations_rest_url) {
|
if (SdkConfig.get().integrations_ui_url && SdkConfig.get().integrations_rest_url) {
|
||||||
ScalarMessaging.startListening();
|
ScalarMessaging.startListening();
|
||||||
global.mxIntegrationManager.client = new ScalarAuthClient();
|
global.mxIntegrationManager.client = new ScalarAuthClient();
|
||||||
|
|
||||||
await global.mxIntegrationManager.client.connect().then(() => {
|
return global.mxIntegrationManager.client.connect().then(() => {
|
||||||
global.mxIntegrationManager.connected = true;
|
global.mxIntegrationManager.connected = true;
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error("Failed to connect to integrations server", e);
|
console.error("Failed to connect to integrations server", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user