Просмотр исходного кода

feat: feature flag for invite functionalities

j8
Bettenbuk Zoltan 5 лет назад
Родитель
Сommit
5429b8568e

+ 6
- 0
react/features/base/flags/constants.js Просмотреть файл

@@ -12,6 +12,12 @@ export const CALENDAR_ENABLED = 'calendar.enabled';
12 12
  */
13 13
 export const CHAT_ENABLED = 'chat.enabled';
14 14
 
15
+/**
16
+ * Flag indicating if invite functionality should be enabled.
17
+ * Default: enabled (true).
18
+ */
19
+export const INVITE_ENABLED = 'invite.enabled';
20
+
15 21
 /**
16 22
  * Flag indicating if recording should be enabled in iOS.
17 23
  * Default: disabled (false).

+ 3
- 1
react/features/invite/components/add-people-dialog/native/InviteButton.js Просмотреть файл

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

Загрузка…
Отмена
Сохранить