2022-12-14 12:23:07 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
|
|
|
import { IStore } from '../app/types';
|
|
|
|
import { ADD_PEOPLE_ENABLED } from '../base/flags/constants';
|
|
|
|
import { getFeatureFlag } from '../base/flags/functions';
|
|
|
|
// @ts-ignore
|
2022-01-25 12:55:57 +00:00
|
|
|
import { navigate } from '../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
|
2022-12-14 12:23:07 +00:00
|
|
|
// @ts-ignore
|
2022-01-25 12:55:57 +00:00
|
|
|
import { screen } from '../mobile/navigation/routes';
|
2022-12-14 12:23:07 +00:00
|
|
|
import { beginShareRoom } from '../share-room/actions';
|
|
|
|
/* eslint-enable lines-around-comment */
|
2020-03-24 12:37:24 +00:00
|
|
|
|
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() {
|
2022-12-14 12:23:07 +00:00
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
2020-03-24 12:37:24 +00:00
|
|
|
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());
|
|
|
|
};
|
|
|
|
}
|