2020-03-24 12:37:24 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import type { Dispatch } from 'redux';
|
|
|
|
|
2022-09-27 07:10:28 +00:00
|
|
|
import { ADD_PEOPLE_ENABLED, getFeatureFlag } from '../base/flags';
|
2022-01-25 12:55:57 +00:00
|
|
|
import { navigate } from '../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
|
|
|
|
import { screen } from '../mobile/navigation/routes';
|
2020-03-24 12:37:24 +00:00
|
|
|
import { beginShareRoom } from '../share-room';
|
|
|
|
|
2020-05-20 10:57:03 +00:00
|
|
|
import { isAddPeopleEnabled, isDialOutEnabled } from './functions';
|
2020-03-24 12:37:24 +00:00
|
|
|
|
|
|
|
export * from './actions.any';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts the process for inviting people. Dpending on the sysstem config it
|
|
|
|
* may use the system share sheet or the invite peoplee dialog.
|
|
|
|
*
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
export function doInvitePeople() {
|
|
|
|
return (dispatch: Dispatch<any>, getState: Function) => {
|
|
|
|
const state = getState();
|
2020-04-29 07:35:18 +00:00
|
|
|
const addPeopleEnabled = getFeatureFlag(state, ADD_PEOPLE_ENABLED, true)
|
2020-03-24 12:37:24 +00:00
|
|
|
&& (isAddPeopleEnabled(state) || isDialOutEnabled(state));
|
|
|
|
|
|
|
|
if (addPeopleEnabled) {
|
2021-10-20 19:29:21 +00:00
|
|
|
return navigate(screen.conference.invite);
|
2020-03-24 12:37:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return dispatch(beginShareRoom());
|
|
|
|
};
|
|
|
|
}
|