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.

actions.native.js 1003B

1234567891011121314151617181920212223242526272829303132
  1. // @flow
  2. import type { Dispatch } from 'redux';
  3. import { getFeatureFlag, ADD_PEOPLE_ENABLED } from '../base/flags';
  4. import { setActiveModalId } from '../base/modal';
  5. import { beginShareRoom } from '../share-room';
  6. import { ADD_PEOPLE_DIALOG_VIEW_ID } from './constants';
  7. import { isAddPeopleEnabled, isDialOutEnabled } from './functions';
  8. export * from './actions.any';
  9. /**
  10. * Starts the process for inviting people. Dpending on the sysstem config it
  11. * may use the system share sheet or the invite peoplee dialog.
  12. *
  13. * @returns {Function}
  14. */
  15. export function doInvitePeople() {
  16. return (dispatch: Dispatch<any>, getState: Function) => {
  17. const state = getState();
  18. const addPeopleEnabled = getFeatureFlag(state, ADD_PEOPLE_ENABLED, true)
  19. && (isAddPeopleEnabled(state) || isDialOutEnabled(state));
  20. if (addPeopleEnabled) {
  21. return dispatch(setActiveModalId(ADD_PEOPLE_DIALOG_VIEW_ID));
  22. }
  23. return dispatch(beginShareRoom());
  24. };
  25. }