Files
jitsi-meet/react/features/base/config/functions.native.js
Дамян Минков fbf9d489f0 fix: Fixes an error with configuration without analytics.
Fixes an error `Cannot convert undefined or null to object` on load.
2021-08-17 12:54:29 -05:00

34 lines
930 B
JavaScript

// @flow
import { NativeModules } from 'react-native';
import { getFeatureFlag, REPLACE_PARTICIPANT } from '../flags';
export * from './functions.any';
/**
* Removes all analytics related options from the given configuration, in case of a libre build.
*
* @param {*} config - The configuration which needs to be cleaned up.
* @returns {void}
*/
export function _cleanupConfig(config: Object) {
config.analytics.scriptURLs = [];
if (NativeModules.AppInfo.LIBRE_BUILD) {
delete config.analytics?.amplitudeAPPKey;
delete config.analytics?.googleAnalyticsTrackingId;
delete config.callStatsID;
delete config.callStatsSecret;
}
}
/**
* Returns the replaceParticipant config.
*
* @param {Object} state - The state of the app.
* @returns {boolean}
*/
export function getReplaceParticipant(state: Object): string {
return getFeatureFlag(state, REPLACE_PARTICIPANT, false);
}