|
@@ -18,7 +18,7 @@ import {
|
18
|
18
|
} from '../base/participants/functions';
|
19
|
19
|
import { toState } from '../base/redux';
|
20
|
20
|
import { normalizeAccents } from '../base/util/strings';
|
21
|
|
-import { getBreakoutRoomsConfig, isInBreakoutRoom } from '../breakout-rooms/functions';
|
|
21
|
+import { isInBreakoutRoom } from '../breakout-rooms/functions';
|
22
|
22
|
|
23
|
23
|
import { QUICK_ACTION_BUTTON, REDUCER_KEY, MEDIA_STATE } from './constants';
|
24
|
24
|
|
|
@@ -141,6 +141,20 @@ export const getComputedOuterHeight = (element: HTMLElement) => {
|
141
|
141
|
*/
|
142
|
142
|
const getState = (state: Object) => state[REDUCER_KEY];
|
143
|
143
|
|
|
144
|
+/**
|
|
145
|
+ * Returns the participants pane config.
|
|
146
|
+ *
|
|
147
|
+ * @param {Function|Object} stateful - The redux store, the redux
|
|
148
|
+ * {@code getState} function, or the redux state itself.
|
|
149
|
+ * @returns {Object}
|
|
150
|
+ */
|
|
151
|
+export const getParticipantsPaneConfig = (stateful: Function | Object) => {
|
|
152
|
+ const state = toState(stateful);
|
|
153
|
+ const { participantsPane = {} } = state['features/base/config'];
|
|
154
|
+
|
|
155
|
+ return participantsPane;
|
|
156
|
+};
|
|
157
|
+
|
144
|
158
|
/**
|
145
|
159
|
* Is the participants pane open.
|
146
|
160
|
*
|
|
@@ -262,22 +276,6 @@ export function participantMatchesSearch(participant: Object, searchString: stri
|
262
|
276
|
return false;
|
263
|
277
|
}
|
264
|
278
|
|
265
|
|
-/**
|
266
|
|
- * Returns whether the participants pane footer menu is visible.
|
267
|
|
- *
|
268
|
|
- * @param {Object} state - Global state.
|
269
|
|
- * @returns {boolean}
|
270
|
|
- */
|
271
|
|
-export const isFooterMenuVisible = (state: Object) => {
|
272
|
|
- const isLocalModerator = isLocalParticipantModerator(state);
|
273
|
|
- const inBreakoutRoom = isInBreakoutRoom(state);
|
274
|
|
- const { hideFooterMenu } = getBreakoutRoomsConfig(state);
|
275
|
|
-
|
276
|
|
- return inBreakoutRoom
|
277
|
|
- ? !hideFooterMenu && isLocalModerator
|
278
|
|
- : isLocalModerator;
|
279
|
|
-};
|
280
|
|
-
|
281
|
279
|
/**
|
282
|
280
|
* Returns whether the more actions button is visible.
|
283
|
281
|
*
|
|
@@ -285,12 +283,11 @@ export const isFooterMenuVisible = (state: Object) => {
|
285
|
283
|
* @returns {boolean}
|
286
|
284
|
*/
|
287
|
285
|
export const isMoreActionsVisible = (state: Object) => {
|
|
286
|
+ const isLocalModerator = isLocalParticipantModerator(state);
|
288
|
287
|
const inBreakoutRoom = isInBreakoutRoom(state);
|
289
|
|
- const { hideMoreActionsButton } = getBreakoutRoomsConfig(state);
|
|
288
|
+ const { hideMoreActionsButton } = getParticipantsPaneConfig(state);
|
290
|
289
|
|
291
|
|
- return inBreakoutRoom
|
292
|
|
- ? !hideMoreActionsButton
|
293
|
|
- : true;
|
|
290
|
+ return inBreakoutRoom ? false : !hideMoreActionsButton && isLocalModerator;
|
294
|
291
|
};
|
295
|
292
|
|
296
|
293
|
/**
|
|
@@ -300,10 +297,9 @@ export const isMoreActionsVisible = (state: Object) => {
|
300
|
297
|
* @returns {boolean}
|
301
|
298
|
*/
|
302
|
299
|
export const isMuteAllVisible = (state: Object) => {
|
|
300
|
+ const isLocalModerator = isLocalParticipantModerator(state);
|
303
|
301
|
const inBreakoutRoom = isInBreakoutRoom(state);
|
304
|
|
- const { hideMuteAllButton } = getBreakoutRoomsConfig(state);
|
|
302
|
+ const { hideMuteAllButton } = getParticipantsPaneConfig(state);
|
305
|
303
|
|
306
|
|
- return inBreakoutRoom
|
307
|
|
- ? !hideMuteAllButton
|
308
|
|
- : true;
|
|
304
|
+ return inBreakoutRoom ? false : !hideMuteAllButton && isLocalModerator;
|
309
|
305
|
};
|