feat(config) add connection indicators flags

This commit is contained in:
Tudor D. Pop
2021-09-09 15:50:22 +03:00
committed by GitHub
parent 49be96799a
commit d95d52843f
7 changed files with 70 additions and 36 deletions

View File

@@ -64,6 +64,11 @@ type Props = AbstractProps & {
*/
_connectionStatus: string,
/**
* Disable/enable inactive indicator.
*/
_connectionIndicatorInactiveDisabled: boolean,
/**
* Whether or not the component should ignore setting a visibility class for
* hiding the component when the connection quality is not strong.
@@ -224,8 +229,11 @@ class ConnectionIndicator extends AbstractConnectionIndicator<Props, AbstractSta
* @returns {ReactElement}
*/
_renderIcon() {
if (this.props._connectionStatus
=== JitsiParticipantConnectionStatus.INACTIVE) {
if (this.props._connectionStatus === JitsiParticipantConnectionStatus.INACTIVE) {
if (this.props._connectionIndicatorInactiveDisabled) {
return null;
}
return (
<span className = 'connection_ninja'>
<Icon
@@ -289,6 +297,8 @@ export function _mapStateToProps(state: Object, ownProps: Props) {
= participantId ? getParticipantById(state, participantId) : getLocalParticipant(state);
return {
_connectionIndicatorInactiveDisabled:
Boolean(state['features/base/config'].connectionIndicators?.inactiveDisabled),
_connectionStatus: participant?.connectionStatus
};
}