diff --git a/src/CallHandler.js b/src/CallHandler.js index 8dfd283e60..40a8d426f8 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -427,7 +427,8 @@ async function _startCallApp(roomId, type) { // URL, but this will at least allow the integration manager to not be hardcoded. widgetUrl = SdkConfig.get().integrations_jitsi_widget_url + '?' + queryString; } else { - widgetUrl = SdkConfig.get().integrations_rest_url + '/widgets/jitsi.html?' + queryString; + const apiUrl = IntegrationManagers.sharedInstance().getPrimaryManager().apiUrl; + widgetUrl = apiUrl + '/widgets/jitsi.html?' + queryString; } const widgetData = { widgetSessionId }; diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 8b87650929..5d3b3ae506 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -239,6 +239,7 @@ import dis from './dispatcher'; import WidgetUtils from './utils/WidgetUtils'; import RoomViewStore from './stores/RoomViewStore'; import { _t } from './languageHandler'; +import {IntegrationManagers} from "./integrations/IntegrationManagers"; function sendResponse(event, res) { const data = JSON.parse(JSON.stringify(event.data)); @@ -548,7 +549,8 @@ const onMessage = function(event) { // (See https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) let configUrl; try { - configUrl = new URL(SdkConfig.get().integrations_ui_url); + // TODO: Support multiple integration managers + configUrl = new URL(IntegrationManagers.sharedInstance().getPrimaryManager().uiUrl); } catch (e) { // No integrations UI URL, ignore silently. return; diff --git a/src/utils/WidgetUtils.js b/src/utils/WidgetUtils.js index 41a241c905..5e127e48d5 100644 --- a/src/utils/WidgetUtils.js +++ b/src/utils/WidgetUtils.js @@ -27,6 +27,7 @@ import WidgetEchoStore from '../stores/WidgetEchoStore'; const WIDGET_WAIT_TIME = 20000; import SettingsStore from "../settings/SettingsStore"; import ActiveWidgetStore from "../stores/ActiveWidgetStore"; +import {IntegrationManagers} from "../integrations/IntegrationManagers"; /** * Encodes a URI according to a set of template variables. Variables will be @@ -102,7 +103,8 @@ export default class WidgetUtils { let scalarUrls = SdkConfig.get().integrations_widgets_urls; if (!scalarUrls || scalarUrls.length === 0) { - scalarUrls = [SdkConfig.get().integrations_rest_url]; + const defaultManager = IntegrationManagers.sharedInstance().getPrimaryManager(); + if (defaultManager) scalarUrls = [defaultManager.apiUrl]; } for (let i = 0; i < scalarUrls.length; i++) {