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

33 lines
1003 B
JavaScript
Raw Normal View History

// @flow
import type { Dispatch } from 'redux';
import { getFeatureFlag, ADD_PEOPLE_ENABLED } from '../base/flags';
2020-04-06 15:26:20 +00:00
import { setActiveModalId } from '../base/modal';
import { beginShareRoom } from '../share-room';
2020-04-06 15:26:20 +00:00
import { ADD_PEOPLE_DIALOG_VIEW_ID } from './constants';
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) {
2020-04-06 15:26:20 +00:00
return dispatch(setActiveModalId(ADD_PEOPLE_DIALOG_VIEW_ID));
}
return dispatch(beginShareRoom());
};
}