Port integration manager class to new dialog props
This commit is contained in:
parent
a5f296457f
commit
ebabc5238d
1 changed files with 7 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2017 New Vector Ltd
|
Copyright 2017 New Vector Ltd
|
||||||
|
Copyright 2019 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -19,11 +20,14 @@ import SdkConfig from './SdkConfig';
|
||||||
import ScalarMessaging from './ScalarMessaging';
|
import ScalarMessaging from './ScalarMessaging';
|
||||||
import ScalarAuthClient from './ScalarAuthClient';
|
import ScalarAuthClient from './ScalarAuthClient';
|
||||||
import RoomViewStore from './stores/RoomViewStore';
|
import RoomViewStore from './stores/RoomViewStore';
|
||||||
|
import MatrixClientPeg from "./MatrixClientPeg";
|
||||||
|
|
||||||
if (!global.mxIntegrationManager) {
|
if (!global.mxIntegrationManager) {
|
||||||
global.mxIntegrationManager = {};
|
global.mxIntegrationManager = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: TravisR - What even is this?
|
||||||
|
|
||||||
export default class IntegrationManager {
|
export default class IntegrationManager {
|
||||||
static _init() {
|
static _init() {
|
||||||
if (!global.mxIntegrationManager.client || !global.mxIntegrationManager.connected) {
|
if (!global.mxIntegrationManager.client || !global.mxIntegrationManager.connected) {
|
||||||
|
@ -62,16 +66,10 @@ export default class IntegrationManager {
|
||||||
console.error("Scalar error", global.mxIntegrationManager);
|
console.error("Scalar error", global.mxIntegrationManager);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const integType = 'type_' + integName;
|
|
||||||
const src = (global.mxIntegrationManager.client && global.mxIntegrationManager.client.hasCredentials()) ?
|
|
||||||
global.mxIntegrationManager.client.getScalarInterfaceUrlForRoom(
|
|
||||||
{roomId: RoomViewStore.getRoomId()},
|
|
||||||
integType,
|
|
||||||
integId,
|
|
||||||
) :
|
|
||||||
null;
|
|
||||||
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
||||||
src: src,
|
room: MatrixClientPeg.get().getRoom(RoomViewStore.getRoomId()),
|
||||||
|
screen: 'type_' + integName,
|
||||||
|
integrationId: integId,
|
||||||
onFinished: onFinished,
|
onFinished: onFinished,
|
||||||
}, "mx_IntegrationsManager");
|
}, "mx_IntegrationsManager");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue