rn,flags: add "toolbox.alwaysVisible" flag

This commit is contained in:
NicolasD 2020-05-13 16:25:06 +02:00 committed by GitHub
parent b7f1f3c659
commit 3043f50ce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -87,6 +87,12 @@ export const RECORDING_ENABLED = 'recording.enabled';
*/ */
export const TILE_VIEW_ENABLED = 'tile-view.enabled'; export const TILE_VIEW_ENABLED = 'tile-view.enabled';
/**
* Flag indicating if the toolbox should be always be visible
* Default: disabled (false).
*/
export const TOOLBOX_ALWAYS_VISIBLE = 'toolbox.alwaysVisible';
/** /**
* Flag indicating if the welcome page should be enabled. * Flag indicating if the welcome page should be enabled.
* Default: disabled (false). * Default: disabled (false).

View File

@ -1,5 +1,6 @@
// @flow // @flow
import { TOOLBOX_ALWAYS_VISIBLE, getFeatureFlag } from '../base/flags';
import { toState } from '../base/redux'; import { toState } from '../base/redux';
/** /**
@ -13,6 +14,7 @@ export function isToolboxVisible(stateful: Object | Function) {
const state = toState(stateful); const state = toState(stateful);
const { alwaysVisible, enabled, visible } = state['features/toolbox']; const { alwaysVisible, enabled, visible } = state['features/toolbox'];
const { length: participantCount } = state['features/base/participants']; const { length: participantCount } = state['features/base/participants'];
const flag = getFeatureFlag(state, TOOLBOX_ALWAYS_VISIBLE, false);
return enabled && (alwaysVisible || visible || participantCount === 1); return enabled && (alwaysVisible || visible || participantCount === 1 || flag);
} }