2019-04-30 10:24:12 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { NativeModules } from 'react-native';
|
|
|
|
|
2021-06-16 11:08:18 +00:00
|
|
|
import { getFeatureFlag, REPLACE_PARTICIPANT } from '../flags';
|
|
|
|
|
2019-04-30 10:24:12 +00:00
|
|
|
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) {
|
2019-10-11 09:46:57 +00:00
|
|
|
config.analytics.scriptURLs = [];
|
2019-04-30 10:24:12 +00:00
|
|
|
if (NativeModules.AppInfo.LIBRE_BUILD) {
|
2021-08-17 17:24:18 +00:00
|
|
|
delete config.analytics?.amplitudeAPPKey;
|
|
|
|
delete config.analytics?.googleAnalyticsTrackingId;
|
2019-04-30 10:24:12 +00:00
|
|
|
delete config.callStatsID;
|
|
|
|
delete config.callStatsSecret;
|
2022-07-21 10:21:27 +00:00
|
|
|
config.giphy = { enabled: false };
|
2019-04-30 10:24:12 +00:00
|
|
|
}
|
|
|
|
}
|
2021-06-16 11:08:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
}
|