|
|
|
|
@ -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)) { |
|
|
|
|
|