Switch to named object

pull/21833/head
Travis Ralston 2020-03-19 11:51:01 -06:00
parent af97ec57d0
commit 92251316a3
1 changed files with 3 additions and 3 deletions

View File

@ -432,7 +432,7 @@ export default class WidgetUtils {
if (app.type === 'jitsi') { if (app.type === 'jitsi') {
console.log("Replacing Jitsi widget URL with local wrapper"); console.log("Replacing Jitsi widget URL with local wrapper");
app.url = WidgetUtils.getLocalJitsiWrapperUrl(true); app.url = WidgetUtils.getLocalJitsiWrapperUrl({forLocalRender: true});
} }
app.url = encodeUri(app.url, params); app.url = encodeUri(app.url, params);
@ -474,7 +474,7 @@ export default class WidgetUtils {
return encodeURIComponent(`${widgetLocation}::${widgetUrl}`); return encodeURIComponent(`${widgetLocation}::${widgetUrl}`);
} }
static getLocalJitsiWrapperUrl(forLocalRender = false) { static getLocalJitsiWrapperUrl(opts: {forLocalRender?: boolean}) {
// NB. we can't just encodeURIComponent all of these because the $ signs need to be there // NB. we can't just encodeURIComponent all of these because the $ signs need to be there
const queryString = [ const queryString = [
'conferenceDomain=$domain', 'conferenceDomain=$domain',
@ -486,7 +486,7 @@ export default class WidgetUtils {
].join('&'); ].join('&');
let currentUrl = window.location.href.split('#')[0]; let currentUrl = window.location.href.split('#')[0];
if (!currentUrl.startsWith("https://") && !forLocalRender) { if (!currentUrl.startsWith("https://") && !opts.forLocalRender) {
// Use an external wrapper if we're not locally rendering the widget. This is usually // Use an external wrapper if we're not locally rendering the widget. This is usually
// the URL that will end up in the widget event, so we want to make sure it's relatively // the URL that will end up in the widget event, so we want to make sure it's relatively
// safe to send. // safe to send.