feat: feature flag for invite functionalities

This commit is contained in:
Bettenbuk Zoltan 2019-10-24 17:41:31 +02:00 committed by Zoltan Bettenbuk
parent 0eccaf9a21
commit 5429b8568e
2 changed files with 9 additions and 1 deletions

View File

@ -12,6 +12,12 @@ export const CALENDAR_ENABLED = 'calendar.enabled';
*/
export const CHAT_ENABLED = 'chat.enabled';
/**
* Flag indicating if invite functionality should be enabled.
* Default: enabled (true).
*/
export const INVITE_ENABLED = 'invite.enabled';
/**
* Flag indicating if recording should be enabled in iOS.
* Default: disabled (false).

View File

@ -2,6 +2,7 @@
import type { Dispatch } from 'redux';
import { getFeatureFlag, INVITE_ENABLED } from '../../../../base/flags';
import { translate } from '../../../../base/i18n';
import { IconAddPeople } from '../../../../base/icons';
import { connect } from '../../../../base/redux';
@ -50,7 +51,8 @@ class InviteButton extends AbstractButton<Props, *> {
* @returns {Object}
*/
function _mapStateToProps(state: Object, ownProps: Object) {
const addPeopleEnabled = isAddPeopleEnabled(state) || isDialOutEnabled(state);
const addPeopleEnabled = getFeatureFlag(state, INVITE_ENABLED, true)
&& (isAddPeopleEnabled(state) || isDialOutEnabled(state));
const { visible = Boolean(addPeopleEnabled) } = ownProps;
return {