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 928B

123456789101112131415161718192021222324252627282930313233
  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. }
  19. }
  20. /**
  21. * Returns the replaceParticipant config.
  22. *
  23. * @param {Object} state - The state of the app.
  24. * @returns {boolean}
  25. */
  26. export function getReplaceParticipant(state: Object): string {
  27. return getFeatureFlag(state, REPLACE_PARTICIPANT, false);
  28. }