fix(config) drop ancient backwards compatibility options

This commit is contained in:
Saúl Ibarra Corretgé 2021-04-22 10:56:22 +02:00 committed by Saúl Ibarra Corretgé
parent 433e212e20
commit 77890fc27a
1 changed files with 2 additions and 37 deletions

View File

@ -2,7 +2,7 @@
import _ from 'lodash';
import { equals, ReducerRegistry, set } from '../redux';
import { equals, ReducerRegistry } from '../redux';
import {
UPDATE_CONFIG,
@ -187,42 +187,7 @@ function _setConfig(state, { config }) {
* supported by jitsi-meet.
*/
function _translateLegacyConfig(oldValue: Object) {
let newValue = oldValue;
const oldConfigToNewConfig = {
analytics: [
[ 'analyticsScriptUrls', 'scriptURLs' ],
[ 'googleAnalyticsTrackingId', 'googleAnalyticsTrackingId' ]
]
};
// Translate the old config properties into the new config properties.
Object.keys(oldConfigToNewConfig).forEach(section => {
if (typeof oldValue[section] !== 'object') {
newValue = set(newValue, section, {});
}
for (const [ oldKey, newKey ] of oldConfigToNewConfig[section]) {
if (oldKey in newValue && !(newKey in newValue[section])) {
const v = newValue[oldKey];
// Do not modify oldValue.
if (newValue === oldValue) {
newValue = {
...newValue
};
}
delete newValue[oldKey];
// Do not modify the section because it may be from oldValue
// i.e. do not modify oldValue.
newValue[section] = {
...newValue[section],
[newKey]: v
};
}
}
});
const newValue = oldValue;
if (!Array.isArray(oldValue.toolbarButtons)
&& typeof interfaceConfig === 'object' && Array.isArray(interfaceConfig.TOOLBAR_BUTTONS)) {