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

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