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.ts 759B

1234567891011121314151617181920
  1. import { IStateful } from '../../base/app/types';
  2. import { CALL_INTEGRATION_ENABLED } from '../../base/flags/constants';
  3. import { getFeatureFlag } from '../../base/flags/functions';
  4. import { toState } from '../../base/redux/functions';
  5. /**
  6. * Checks if call integration is enabled or not.
  7. *
  8. * @param {Function|Object} stateful - The redux store or {@code getState}
  9. * function.
  10. * @returns {string} - Default URL for the app.
  11. */
  12. export function isCallIntegrationEnabled(stateful: IStateful) {
  13. const state = toState(stateful);
  14. const { disableCallIntegration } = state['features/base/settings'];
  15. const flag = getFeatureFlag(state, CALL_INTEGRATION_ENABLED);
  16. // The feature flag has precedence.
  17. return flag ?? !disableCallIntegration;
  18. }