jiti-meet/react/features/invite/actions.native.ts

35 lines
1.2 KiB
TypeScript
Raw Normal View History

/* 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';
// @ts-ignore
2022-01-25 12:55:57 +00:00
import { screen } from '../mobile/navigation/routes';
import { beginShareRoom } from '../share-room/actions';
/* eslint-enable lines-around-comment */
2020-05-20 10:57:03 +00:00
import { isAddPeopleEnabled, isDialOutEnabled } from './functions';
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: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const addPeopleEnabled = getFeatureFlag(state, ADD_PEOPLE_ENABLED, true)
&& (isAddPeopleEnabled(state) || isDialOutEnabled(state));
if (addPeopleEnabled) {
return navigate(screen.conference.invite);
}
return dispatch(beginShareRoom());
};
}