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

33 lines
1.0 KiB
JavaScript
Raw Normal View History

// @flow
import type { Dispatch } from 'redux';
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';
import { beginShareRoom } from '../share-room';
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: Dispatch<any>, getState: Function) => {
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());
};
}