|
@@ -6,9 +6,10 @@ import { APP_WILL_MOUNT } from '../app';
|
6
|
6
|
import { getFeatureFlag } from '../flags/functions';
|
7
|
7
|
import { addKnownDomains } from '../known-domains';
|
8
|
8
|
import { MiddlewareRegistry } from '../redux';
|
|
9
|
+import { updateSettings } from '../settings';
|
9
|
10
|
import { parseURIString } from '../util';
|
10
|
11
|
|
11
|
|
-import { SET_CONFIG } from './actionTypes';
|
|
12
|
+import { SET_CONFIG, OVERWRITE_CONFIG } from './actionTypes';
|
12
|
13
|
import { updateConfig } from './actions';
|
13
|
14
|
import { _CONFIG_STORE_PREFIX } from './constants';
|
14
|
15
|
|
|
@@ -26,6 +27,9 @@ MiddlewareRegistry.register(store => next => action => {
|
26
|
27
|
|
27
|
28
|
case SET_CONFIG:
|
28
|
29
|
return _setConfig(store, next, action);
|
|
30
|
+
|
|
31
|
+ case OVERWRITE_CONFIG:
|
|
32
|
+ return _updateSettings(store, next, action);
|
29
|
33
|
}
|
30
|
34
|
|
31
|
35
|
return next(action);
|
|
@@ -115,6 +119,12 @@ function _setConfig({ dispatch, getState }, next, action) {
|
115
|
119
|
config.resolution = resolutionFlag;
|
116
|
120
|
}
|
117
|
121
|
|
|
122
|
+ if (action.config.doNotFlipLocalVideo === true) {
|
|
123
|
+ dispatch(updateSettings({
|
|
124
|
+ localFlipX: false
|
|
125
|
+ }));
|
|
126
|
+ }
|
|
127
|
+
|
118
|
128
|
dispatch(updateConfig(config));
|
119
|
129
|
|
120
|
130
|
// FIXME On Web we rely on the global 'config' variable which gets altered
|
|
@@ -128,3 +138,27 @@ function _setConfig({ dispatch, getState }, next, action) {
|
128
|
138
|
|
129
|
139
|
return result;
|
130
|
140
|
}
|
|
141
|
+
|
|
142
|
+/**
|
|
143
|
+ * Updates settings based on some config values.
|
|
144
|
+ *
|
|
145
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
146
|
+ * is being dispatched.
|
|
147
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
148
|
+ * specified {@code action} in the specified {@code store}.
|
|
149
|
+ * @param {Action} action - The redux action which is being {@code dispatch}ed
|
|
150
|
+ * in the specified {@code store}.
|
|
151
|
+ * @private
|
|
152
|
+ * @returns {*} The return value of {@code next(action)}.
|
|
153
|
+ */
|
|
154
|
+function _updateSettings({ dispatch }, next, action) {
|
|
155
|
+ const { config: { doNotFlipLocalVideo } } = action;
|
|
156
|
+
|
|
157
|
+ if (doNotFlipLocalVideo === true) {
|
|
158
|
+ dispatch(updateSettings({
|
|
159
|
+ localFlipX: false
|
|
160
|
+ }));
|
|
161
|
+ }
|
|
162
|
+
|
|
163
|
+ return next(action);
|
|
164
|
+}
|