You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.native.js 973B

12345678910111213141516171819202122232425262728293031323334
  1. // @flow
  2. import { NativeModules } from 'react-native';
  3. import { getFeatureFlag, REPLACE_PARTICIPANT } from '../flags';
  4. export * from './functions.any';
  5. /**
  6. * Removes all analytics related options from the given configuration, in case of a libre build.
  7. *
  8. * @param {*} config - The configuration which needs to be cleaned up.
  9. * @returns {void}
  10. */
  11. export function _cleanupConfig(config: Object) {
  12. config.analytics.scriptURLs = [];
  13. if (NativeModules.AppInfo.LIBRE_BUILD) {
  14. delete config.analytics?.amplitudeAPPKey;
  15. delete config.analytics?.googleAnalyticsTrackingId;
  16. delete config.callStatsID;
  17. delete config.callStatsSecret;
  18. config.giphy = { enabled: false };
  19. }
  20. }
  21. /**
  22. * Returns the replaceParticipant config.
  23. *
  24. * @param {Object} state - The state of the app.
  25. * @returns {boolean}
  26. */
  27. export function getReplaceParticipant(state: Object): string {
  28. return getFeatureFlag(state, REPLACE_PARTICIPANT, false);
  29. }