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.ts 1.1KB

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