Disable buttons only when token features is enabled. Fixes #3355. (#3443)

* Disable buttons only when token features is enabled. Fixes #3355.

* squash: update disabled check.

* squash: update disabled and disabledByFeatures.
This commit is contained in:
Дамян Минков
2018-09-11 17:33:45 -05:00
committed by virtuacoplenny
parent 32fbcb17b9
commit fd30481ac2
4 changed files with 29 additions and 15 deletions

View File

@@ -3,7 +3,6 @@
import { connect } from 'react-redux';
import { translate } from '../../../base/i18n';
import { getLocalParticipant } from '../../../base/participants';
import AbstractLiveStreamButton, {
_mapStateToProps as _abstractMapStateToProps,
@@ -85,15 +84,14 @@ class LiveStreamButton extends AbstractLiveStreamButton<Props> {
*/
function _mapStateToProps(state: Object, ownProps: Props) {
const abstractProps = _abstractMapStateToProps(state, ownProps);
const localParticipant = getLocalParticipant(state);
const { features = {} } = localParticipant;
let { visible } = ownProps;
const _disabledByFeatures = abstractProps.disabledByFeatures;
let _disabled = false;
let _liveStreamDisabledTooltipKey;
if (!abstractProps.visible
&& String(features.livestreaming) !== 'disabled') {
&& _disabledByFeatures !== undefined && !_disabledByFeatures) {
_disabled = true;
// button and tooltip
@@ -108,7 +106,8 @@ function _mapStateToProps(state: Object, ownProps: Props) {
if (typeof visible === 'undefined') {
visible = interfaceConfig.TOOLBAR_BUTTONS.includes('livestreaming')
&& (abstractProps.visible || _liveStreamDisabledTooltipKey);
&& (abstractProps.visible
|| Boolean(_liveStreamDisabledTooltipKey));
}
return {