fix(optimise): cope with URL interface config overrides

Regresssion from bd8a7edbd2.

When the toolbar buttons are overridden with URL parameters, our computed set of
buttons will be wrong. Thus, compute it every time and check for the
differences.
This commit is contained in:
Saúl Ibarra Corretgé 2020-03-04 12:01:54 +01:00 committed by Дамян Минков
parent aa11535db7
commit d7ece58c6f
2 changed files with 12 additions and 4 deletions

View File

@ -2,7 +2,7 @@
import React, { Component } from 'react';
import { connect } from '../../../base/redux';
import { connect, equals } from '../../../base/redux';
import { SettingsButton } from '../../../settings';
import {
AudioMuteButton,
@ -88,9 +88,13 @@ class Toolbar extends Component<Props> {
function _mapStateToProps(state): Object { // eslint-disable-line no-unused-vars
// XXX: We are not currently using state here, but in the future, when
// interfaceConfig is part of redux we will.
//
// NB: We compute the buttons again here because if URL parameters were used to
// override them we'd miss it.
const buttons = new Set(interfaceConfig.TOOLBAR_BUTTONS);
return {
_visibleButtons: visibleButtons
_visibleButtons: equals(visibleButtons, buttons) ? visibleButtons : buttons
};
}

View File

@ -28,7 +28,7 @@ import {
getParticipants,
participantUpdated
} from '../../../base/participants';
import { connect } from '../../../base/redux';
import { connect, equals } from '../../../base/redux';
import { OverflowMenuItem } from '../../../base/toolbox';
import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
import { VideoBlurButton } from '../../../blur';
@ -1330,6 +1330,10 @@ function _mapStateToProps(state) {
}
}
// NB: We compute the buttons again here because if URL parameters were used to
// override them we'd miss it.
const buttons = new Set(interfaceConfig.TOOLBAR_BUTTONS);
return {
_chatOpen: state['features/chat'].isOpen,
_conference: conference,
@ -1351,7 +1355,7 @@ function _mapStateToProps(state) {
|| sharedVideoStatus === 'start'
|| sharedVideoStatus === 'pause',
_visible: isToolboxVisible(state),
_visibleButtons: visibleButtons
_visibleButtons: equals(visibleButtons, buttons) ? visibleButtons : buttons
};
}