From 9ac7c97e67378f50c226a879ba2dc156643907d0 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Thu, 16 Feb 2017 13:53:19 -0600 Subject: [PATCH] [RN] Enforce mandatory mobile app-specific config --- react/features/base/lib-jitsi-meet/reducer.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/react/features/base/lib-jitsi-meet/reducer.js b/react/features/base/lib-jitsi-meet/reducer.js index d3453854c..d62635618 100644 --- a/react/features/base/lib-jitsi-meet/reducer.js +++ b/react/features/base/lib-jitsi-meet/reducer.js @@ -8,7 +8,7 @@ import { } from './actionTypes'; /** - * Initial state of 'features/base/lib-jitsi-meet'. + * The initial state of 'features/base/lib-jitsi-meet'. * * @type {{ * initializationError: null, @@ -16,6 +16,14 @@ import { * }} */ const INITIAL_STATE = { + /** + * The mandatory configuration to be passed to JitsiMeetJS#init(). The app + * will download config.js from the Jitsi Meet deployment and taks its + * values into account but the values bellow will be enforced (because they + * are essential to the correct execution of the application). + * + * @type {Object} + */ config: { // FIXME The support for audio levels in lib-jitsi-meet polls the // statistics of WebRTC at a short interval multiple times a second. @@ -80,10 +88,12 @@ function _setConfig(state, action) { return { ...state, config: { - // The final config is the result of augmenting the default config - // with whatever the deployment has chosen to override/overwrite. - ...INITIAL_STATE.config, - ...action.config + ...action.config, + + // The config of INITIAL_STATE is meant to override the config + // downloaded from the Jitsi Meet deployment because the former + // contains values that are mandatory. + ...INITIAL_STATE.config } }; }