|
@@ -3,8 +3,15 @@
|
3
|
3
|
import type { Dispatch } from 'redux';
|
4
|
4
|
|
5
|
5
|
import { createToolbarEvent, sendAnalytics } from '../../../analytics';
|
|
6
|
+import {
|
|
7
|
+ getFeatureFlag,
|
|
8
|
+ LOBBY_MODE_ENABLED,
|
|
9
|
+ MEETING_PASSWORD_ENABLED,
|
|
10
|
+ SECURITY_OPTIONS_ENABLED
|
|
11
|
+} from '../../../base/flags';
|
6
|
12
|
import { translate } from '../../../base/i18n';
|
7
|
13
|
import { IconSecurityOff, IconSecurityOn } from '../../../base/icons';
|
|
14
|
+import { isLocalParticipantModerator } from '../../../base/participants';
|
8
|
15
|
import { connect } from '../../../base/redux';
|
9
|
16
|
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
|
10
|
17
|
import { toggleSecurityDialog } from '../../actions';
|
|
@@ -62,11 +69,19 @@ class SecurityDialogButton extends AbstractButton<Props, *> {
|
62
|
69
|
* @returns {Props}
|
63
|
70
|
*/
|
64
|
71
|
function mapStateToProps(state: Object) {
|
|
72
|
+ const { conference } = state['features/base/conference'];
|
|
73
|
+ const { hideLobbyButton } = state['features/base/config'];
|
65
|
74
|
const { locked } = state['features/base/conference'];
|
66
|
75
|
const { lobbyEnabled } = state['features/lobby'];
|
|
76
|
+ const lobbySupported = conference && conference.isLobbySupported();
|
|
77
|
+ const lobby = lobbySupported && isLocalParticipantModerator(state) && !hideLobbyButton;
|
|
78
|
+ const enabledFlag = getFeatureFlag(state, SECURITY_OPTIONS_ENABLED, true);
|
|
79
|
+ const enabledLobbyModeFlag = getFeatureFlag(state, LOBBY_MODE_ENABLED, true) && lobby;
|
|
80
|
+ const enabledMeetingPassFlag = getFeatureFlag(state, MEETING_PASSWORD_ENABLED, true);
|
67
|
81
|
|
68
|
82
|
return {
|
69
|
|
- _locked: locked || lobbyEnabled
|
|
83
|
+ _locked: locked || lobbyEnabled,
|
|
84
|
+ visible: enabledFlag || (enabledLobbyModeFlag || enabledMeetingPassFlag)
|
70
|
85
|
};
|
71
|
86
|
}
|
72
|
87
|
|