Coding style: formatting, comments

This commit is contained in:
Lyubo Marinov 2018-05-18 08:19:25 -05:00
parent 5bd975e3f3
commit 21c1e4abc4
2 changed files with 16 additions and 18 deletions

View File

@ -61,7 +61,7 @@ type Props = {
_onHardwareBackPress: Function,
/**
* Number of participants in the conference.
* The number of participants in the conference.
*
* @private
*/
@ -129,12 +129,10 @@ class Conference extends Component<Props> {
this._onHardwareBackPress);
}
// Show the toolbar if we are the only participant.
// Show the toolbox if we are the only participant.
const { _participantCount, _setToolboxVisible } = this.props;
if (_participantCount === 1) {
_setToolboxVisible(true);
}
_participantCount === 1 && _setToolboxVisible(true);
}
/**
@ -159,14 +157,16 @@ class Conference extends Component<Props> {
* that this instance will receive.
* @returns {void}
*/
componentWillReceiveProps(nextProps) {
const oldParticipantCount = this.props._participantCount;
const newParticipantCount = nextProps._participantCount;
componentWillReceiveProps({ _participantCount: newParticipantCount }) {
const {
_participantCount: oldParticipantCount,
_setToolboxVisible
} = this.props;
if (oldParticipantCount === 1 && newParticipantCount > 1) {
this.props._setToolboxVisible(false);
} else if (oldParticipantCount > 1 && newParticipantCount === 1) {
this.props._setToolboxVisible(true);
if (oldParticipantCount === 1) {
newParticipantCount > 1 && _setToolboxVisible(false);
} else if (oldParticipantCount > 1) {
newParticipantCount === 1 && _setToolboxVisible(true);
}
}
@ -373,6 +373,7 @@ function _mapDispatchToProps(dispatch) {
* @private
* @returns {{
* _connecting: boolean,
* _participantCount: number,
* _reducedUI: boolean,
* _toolboxVisible: boolean
* }}
@ -408,7 +409,7 @@ function _mapStateToProps(state) {
_connecting: Boolean(connecting_),
/**
* Number of participants in the conference.
* The number of participants in the conference.
*
* @private
* @type {number}

View File

@ -1,6 +1,6 @@
// @flow
import { ReducerRegistry } from '../base/redux';
import { ReducerRegistry, set } from '../base/redux';
import {
CLEAR_TOOLBOX_TIMEOUT,
@ -149,10 +149,7 @@ ReducerRegistry.register(
};
case SET_TOOLBOX_VISIBLE:
return {
...state,
visible: action.visible
};
return set(state, 'visible', action.visible);
}
return state;