From 9e7f8d0e16770fcdef89f592852add558c0a65d9 Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Fri, 19 May 2017 16:06:10 -0700 Subject: [PATCH] SQUASH: use redux to get config --- react/features/invite/actions.js | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/react/features/invite/actions.js b/react/features/invite/actions.js index 0c2a38063..f9fb82f0b 100644 --- a/react/features/invite/actions.js +++ b/react/features/invite/actions.js @@ -8,29 +8,6 @@ import { InviteDialog } from './components'; declare var $: Function; declare var APP: Object; -declare var config: Object; - -/** - * The url for the api that matches a conference name and muc to an id. - * - * @type {string} - */ -const DIAL_IN_CONF_CODE_URL = config.dialInConfCodeUrl; - -/** - * The url for the api that returns phone numbers to dial in to the conference - * and join using the conference id. - * - * @type {string} - */ -const DIAL_IN_NUMBERS_URLS = config.dialInNumbersUrl; - -/** - * The url for the MUC component joined for the conference. - * - * @type {string} - */ -const MUC_URL = config.hosts && config.hosts.muc; /** * Opens the Invite Dialog. @@ -50,8 +27,11 @@ export function openInviteDialog() { */ export function updateDialInNumbers() { return (dispatch, getState) => { + const { dialInConfCodeUrl, dialInNumbersUrl, hosts } + = getState()['features/base/config']; + const mucUrl = hosts && hosts.muc; - if (!DIAL_IN_CONF_CODE_URL || !DIAL_IN_NUMBERS_URLS || !MUC_URL) { + if (!dialInConfCodeUrl || !dialInNumbersUrl || !mucUrl) { dispatch({ type: UPDATE_DIAL_IN_NUMBERS_FAILED, error: 'URLs for fetching dial in numbers not properly defined' @@ -62,10 +42,10 @@ export function updateDialInNumbers() { const { room } = getState()['features/base/conference']; const conferenceIdUrl - = `${DIAL_IN_CONF_CODE_URL}?conference=${room}@${MUC_URL}`; + = `${dialInConfCodeUrl}?conference=${room}@${mucUrl}`; Promise.all([ - $.getJSON(DIAL_IN_NUMBERS_URLS), + $.getJSON(dialInNumbersUrl), $.getJSON(conferenceIdUrl) ]).then(([ numbersResponse, idResponse ]) => { if (!idResponse.conference || !idResponse.id) {