Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 018b4f5

Browse files
committed
Use the default integration manager for config options
1 parent 5a15e78 commit 018b4f5

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/CallHandler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ async function _startCallApp(roomId, type) {
427427
// URL, but this will at least allow the integration manager to not be hardcoded.
428428
widgetUrl = SdkConfig.get().integrations_jitsi_widget_url + '?' + queryString;
429429
} else {
430-
widgetUrl = SdkConfig.get().integrations_rest_url + '/widgets/jitsi.html?' + queryString;
430+
const apiUrl = IntegrationManagers.sharedInstance().getPrimaryManager().apiUrl;
431+
widgetUrl = apiUrl + '/widgets/jitsi.html?' + queryString;
431432
}
432433

433434
const widgetData = { widgetSessionId };

src/ScalarMessaging.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ import dis from './dispatcher';
239239
import WidgetUtils from './utils/WidgetUtils';
240240
import RoomViewStore from './stores/RoomViewStore';
241241
import { _t } from './languageHandler';
242+
import {IntegrationManagers} from "./integrations/IntegrationManagers";
242243

243244
function sendResponse(event, res) {
244245
const data = JSON.parse(JSON.stringify(event.data));
@@ -548,7 +549,8 @@ const onMessage = function(event) {
548549
// (See https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)
549550
let configUrl;
550551
try {
551-
configUrl = new URL(SdkConfig.get().integrations_ui_url);
552+
// TODO: Support multiple integration managers
553+
configUrl = new URL(IntegrationManagers.sharedInstance().getPrimaryManager().uiUrl);
552554
} catch (e) {
553555
// No integrations UI URL, ignore silently.
554556
return;

src/utils/WidgetUtils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import WidgetEchoStore from '../stores/WidgetEchoStore';
2727
const WIDGET_WAIT_TIME = 20000;
2828
import SettingsStore from "../settings/SettingsStore";
2929
import ActiveWidgetStore from "../stores/ActiveWidgetStore";
30+
import {IntegrationManagers} from "../integrations/IntegrationManagers";
3031

3132
/**
3233
* Encodes a URI according to a set of template variables. Variables will be
@@ -102,7 +103,8 @@ export default class WidgetUtils {
102103

103104
let scalarUrls = SdkConfig.get().integrations_widgets_urls;
104105
if (!scalarUrls || scalarUrls.length === 0) {
105-
scalarUrls = [SdkConfig.get().integrations_rest_url];
106+
const defaultManager = IntegrationManagers.sharedInstance().getPrimaryManager();
107+
if (defaultManager) scalarUrls = [defaultManager.apiUrl];
106108
}
107109

108110
for (let i = 0; i < scalarUrls.length; i++) {

0 commit comments

Comments
 (0)